-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#65, refactor ast for tags/links] #66
Conversation
|
[#65][m]: refactor to have all parsing and extraction of info from markdown in one file. Specifically we parse to an AST once and then pass that AST to extraction functions. Motivation is KISS and simpler, more readable code plus (minor for now) better performance. |
const links = extractWikiLinks(options?.from || "", source, { | ||
permalinks: options?.permalinks, | ||
}); | ||
const links = extractWikiLinks(ast, options); | ||
|
||
return { | ||
metadata, | ||
links, | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a short comment
// we just factor this function out so we can reuse it in tests of extractTagsFromBody etc
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces?
[test: string]: (node: any) => WikiLink; | ||
} | ||
|
||
export interface WikiLink { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why called WikiLink and not just link
No description provided.