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
So how can I get the result with the attribute id?
After simply reading the source code of Remarkable I found Remarkable did not have the logic of setting id, so my approach above should not be correct...
note: I am not a native speaker, excuse me.
The text was updated successfully, but these errors were encountered:
constmd=newRemarkable(opts.markdown);constrender=md.renderer.render;constoutput=md.use(toc.plugin()).render(file.content);md.renderer.rules.heading_open=function(tokens,idx){consttok=tokens[idx];consttokContent=tokens[idx+1];if(tokContent.slug){constheading='<h'+tok.hLevel+' id="'+tokContent.slug+'">';constanchor='<a'+' href="#'+tokContent.slug+'"'+' title="Link to this heading"'+' class="anchor"'+' aria-hidden="true"'+'></a>';returnheading+anchor;}return'<h'+tok.hLevel+'>';};file.content=render.call(md.renderer,output.tokens,md.options);file.data.toc=output.json;
My demand:
I want to get the catalog content and the html result. The html tag h1,h2,h3... should have id so the anchor will take effect.
but after:
The result :
The result which I need:
So how can I get the result with the attribute id?
After simply reading the source code of Remarkable I found Remarkable did not have the logic of setting id, so my approach above should not be correct...
note: I am not a native speaker, excuse me.
The text was updated successfully, but these errors were encountered: