6 Commits

Author SHA1 Message Date
64c1cdb715 0.3.3 2023-06-03 18:13:25 -07:00
950e04ae57 allow for more characters in citations 2023-06-03 18:13:18 -07:00
0330c0ec71 0.3.2 2023-05-27 18:10:32 -07:00
bc031e8639 enable headers to have inline sub-elements 2023-05-27 18:10:26 -07:00
b016f77c51 0.3.1 2023-05-26 19:28:22 -07:00
e127195eaa remove console.log 2023-05-26 19:28:18 -07:00
5 changed files with 7 additions and 8 deletions

4
package-lock.json generated
View File

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

View File

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

View File

@@ -116,7 +116,6 @@ export function description_list_ext(renderer: marked.Renderer, opts: MarkdownOp
render_current();
if (token.items.length) {
console.log(token);
return token;
}
},

View File

@@ -23,7 +23,7 @@ export function footnote_ref_ext(renderer: marked.Renderer, opts: MarkdownOption
level: 'inline',
start: (src) => src.match(/\[\^/)?.index,
tokenizer(src, tokens) {
const rule = /^\[\^([a-zA-Z0-9-._§]+)]/;
const rule = /^\[\^([a-zA-Z0-9-\._, §]+)]/;
const match = rule.exec(src);
if (match) {
@@ -68,7 +68,7 @@ export function footnote_list_ext(renderer: marked.Renderer, opts: MarkdownOptio
};
let remaining = src;
const prefix_rule = /^\[\^([a-zA-Z0-9\._§-]+)]:/;
const prefix_rule = /^\[\^([a-zA-Z0-9\., _§-]+)]:/;
const whitespace_rule = /^\s*(?:\n|$)/;
if (! prefix_rule.test(src)) {

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(raw);
let { text, id, html_attrs } = parse_attributes(orig_text);
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}>`;
};
}