inline code wrong highlight detection fix (#87)

This commit is contained in:
Utsob Roy 2023-02-23 15:22:33 +06:00 committed by GitHub
parent c1891a3ee3
commit 486a8a262f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 11 deletions

View File

@ -18,6 +18,7 @@ module.exports = function (eleventyConfig) {
breaks: true,
html: true,
})
.use(require("markdown-it-mark"))
.use(require("markdown-it-footnote"))
.use(function (md) {
md.renderer.rules.hashtag_open = function (tokens, idx) {
@ -190,15 +191,6 @@ module.exports = function (eleventyConfig) {
);
});
eleventyConfig.addFilter("highlight", function (str) {
return (
str &&
str.replace(/\=\=(.*?)\=\=/g, function (match, p1) {
return `<mark>${p1}</mark>`;
})
);
});
eleventyConfig.addFilter("taggify", function (str) {
return (
str &&

11
package-lock.json generated
View File

@ -23,6 +23,7 @@
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.6",
"markdown-it-footnote": "^3.0.3",
"markdown-it-mark": "^3.0.1",
"markdown-it-mathjax3": "^4.3.1",
"markdown-it-plantuml": "^1.4.1",
"markdown-it-task-checkbox": "^1.0.6"
@ -2918,6 +2919,11 @@
"resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz",
"integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w=="
},
"node_modules/markdown-it-mark": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz",
"integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A=="
},
"node_modules/markdown-it-mathjax3": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/markdown-it-mathjax3/-/markdown-it-mathjax3-4.3.2.tgz",
@ -7566,6 +7572,11 @@
"resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz",
"integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w=="
},
"markdown-it-mark": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz",
"integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A=="
},
"markdown-it-mathjax3": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/markdown-it-mathjax3/-/markdown-it-mathjax3-4.3.2.tgz",

View File

@ -38,6 +38,7 @@
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.6",
"markdown-it-footnote": "^3.0.3",
"markdown-it-mark": "^3.0.1",
"markdown-it-mathjax3": "^4.3.1",
"markdown-it-plantuml": "^1.4.1",
"markdown-it-task-checkbox": "^1.0.6"

View File

@ -57,7 +57,7 @@ permalink: "notes/{{ page.fileSlug | slugify }}/"
{% for imp in dynamics.notes.beforeContent %}
{% include imp %}
{% endfor %}
{{ content | hideDataview | link | taggify | highlight | safe}}
{{ content | hideDataview | link | taggify | safe}}
{% for imp in dynamics.common.afterContent %}
{% include imp %}
{% endfor %}

View File

@ -53,7 +53,7 @@
{% include imp %}
{% endfor %}
{%- for garden in collections.gardenEntry -%}
{{garden.templateContent | hideDataview | link | taggify | highlight | safe }}
{{garden.templateContent | hideDataview | link | taggify | safe }}
{%- endfor -%}
{% for imp in dynamics.common.afterContent %}
{% include imp %}