Browse Source

Add the non license.

master
Zed A. Shaw 1 month ago
parent
commit
5c536d3a8b
1 changed files with 20 additions and 1 deletions
  1. +20
    -1
      lib/docs.js

+ 20
- 1
lib/docs.js View File

@@ -61,7 +61,11 @@ const render = (raw_md, base_url, cb=null_cb) => {
const renderer = new Remarkable('full', {
html: true,
highlight
}).use(linkify).use(rem => {
});

renderer.use(linkify);

renderer.use(rem => {
rem.renderer.rules.heading_open = (tokens, idx) => {
let level = tokens[idx].hLevel;
let content = tokens[idx + 1].content;
@@ -75,6 +79,21 @@ const render = (raw_md, base_url, cb=null_cb) => {
}
});

renderer.use(rem => {
const orig_open = rem.renderer.rules.link_open;
const orig_close = rem.renderer.rules.link_close;

rem.renderer.rules.link_open = (tokens, idx, options) => {
console.log("!!!!!!!!!!!!!!!!!!!!! LINK OPEN", tokens, idx, options);
return orig_open(tokens, idx, options);
}

rem.renderer.rules.link_close = (tokens, idx, options) => {
console.log("!!!!!!!!!!!!!!!!!!!!! LINK CLOSE", tokens, idx, options);
return orig_close(tokens, idx, options);
}
});

let content = renderer.render(cb(metadata, body));

// now we can use the TOC to figure out a title


Loading…
Cancel
Save