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
Using the marked engine, an anchor ID will also be created, first by performing the following transformations (per the Markdown spec):
strip out non alphanumeric characters
convert all text to lowercase
replace spaces with -
append a number at the end, if there are repeats
As an example, ## {{build_sequence.op003}} will generate the following anchor link: http://localhost:3000/#/docs/guide?id=final-section.
However if I attempt to internally link from a different page:
Here is an anchor link directly passed in: [link](#{{build_sequence.op003}})
This will not resolve with a link to http://localhost:3000/#/docs/guide?id=final-section. Instead, it will parse to: Here is an anchor link directly passed in: [link](#Final Section)
I also tried this using triple braces (mustache escape sequence) and this didn't help.
I believe what's happening is that the "marked" renderer running in the background first parses HTML links, then later, the mustache plugin renders all it's own function calls. In reading the docsify documentation, it seems that the behavior of the parser can be changed here, but this is where I get stuck, as I don't have the expertise in Javascript.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all, I'm using Docsify with the following setup:
Relevant section of index.html
For mustache templates (link), the key value pairs are structured as JSON files.
Relevant section of docs/vars.json
So if I write up a markdown page with the following format, it will render properly:
Using the marked engine, an anchor ID will also be created, first by performing the following transformations (per the
Markdown
spec):-
As an example,
## {{build_sequence.op003}}
will generate the following anchor link:http://localhost:3000/#/docs/guide?id=final-section
.However if I attempt to internally link from a different page:
This will not resolve with a link to
http://localhost:3000/#/docs/guide?id=final-section
. Instead, it will parse to:Here is an anchor link directly passed in: [link](#Final Section)
I also tried this using triple braces (mustache escape sequence) and this didn't help.
I believe what's happening is that the "marked" renderer running in the background first parses HTML links, then later, the mustache plugin renders all it's own function calls. In reading the docsify documentation, it seems that the behavior of the parser can be changed here, but this is where I get stuck, as I don't have the expertise in Javascript.
Is there a way to force the intended behavior?
Beta Was this translation helpful? Give feedback.
All reactions