Compare commits

..

No commits in common. "0330c0ec718ca7486f0bc143a57d5d7709bf2455" and "b016f77c51b076b23a86a5524d353fdaa000ee68" have entirely different histories.

3 changed files with 5 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@doc-utils/markdown2html",
"version": "0.3.2",
"version": "0.3.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@doc-utils/markdown2html",
"version": "0.3.2",
"version": "0.3.1",
"dependencies": {
"bytefield-svg": "^1.6.1",
"dompurify": "^2.3.6",

View File

@ -1,6 +1,6 @@
{
"name": "@doc-utils/markdown2html",
"version": "0.3.2",
"version": "0.3.1",
"publishConfig": {
"registry": "https://gitea.home.jbrumond.me/api/packages/doc-utils/npm/"
},

View File

@ -29,14 +29,14 @@ export function create_renderer(opts: MarkdownOptions) {
function heading(renderer: marked.Renderer, opts: MarkdownOptions) {
return function(orig_text: string, level: 1 | 2 | 3 | 4 | 5 | 6, raw: string) {
let { text, id, html_attrs } = parse_attributes(orig_text);
let { text, id, html_attrs } = parse_attributes(raw);
if (id) {
text += `\n<a class="heading-anchor" href="#${id}">`
+ `\n\t\t${icons.link}`
+ `\n\t\t<span style="display: none">Section titled ${text}</span>`
+ `\n\t</a>`;
}
return `\n<h${level} ${html_attrs.join(' ')}>\n\t${text}\n</h${level}>`;
};
}