You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using marked for an doc site recently, marked is a good library but when I realize that I need a TOC, it does not work very well. There are existing solutions like #545 ,while reading marked docs, I found a better(👀maybe?) solution, that is:
marked.lexer
for example, suppose we have the following markdown text
# A> please ignore me ## B# C## D
then we use marked.lexer(markdownText) to get the tokens:
Hi guys!
I have been using
marked
for an doc site recently,marked
is a good library but when I realize that I need a TOC, it does not work very well. There are existing solutions like #545 ,while readingmarked
docs, I found a better(👀maybe?) solution, that is:marked.lexer
for example, suppose we have the following markdown text
then we use
marked.lexer(markdownText)
to get the tokens:wow! that's all we need, right? now we can filter these headings and do whatever we want!
👏 That's all, wish this could help, thanks!
The text was updated successfully, but these errors were encountered: