π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
fix(markdown): underline now use double ` _` and remove markdown-it-underline dependency
Smaug67398e8512353470
diff --git a/frontend/app/components/MarkdownSyntax.vue b/frontend/app/components/MarkdownSyntax.vueindex 64b60ebb..bd2116b9 100644--- a/frontend/app/components/MarkdownSyntax.vue+++ b/frontend/app/components/MarkdownSyntax.vue@@ -9,7 +9,7 @@<ul><li><strong>Bold</strong>: <code>**bold**</code> or <code>__bold__</code></li><li><em>Italic</em>: <code>*italic*</code> or <code>_italic_</code></li>- <li><u>Underline</u>: <code>_underline_</code></li>+ <li><u>Underline</u>: <code>__underline__</code></li><li><del>Strikethrough</del>: <code>~~strikethrough~~</code></li><li><mark>Highlight</mark>: <code>==highlight==</code></li><li>Superscript: <sup>text</sup> <code>^text^</code></li>diff --git a/frontend/app/helpers/markdown/index.ts b/frontend/app/helpers/markdown/index.tsindex 9b911bce..9429b70f 100644--- a/frontend/app/helpers/markdown/index.ts+++ b/frontend/app/helpers/markdown/index.ts@@ -4,8 +4,7 @@ import { anchorPlugin } from './anchor';import { containerSvg } from './containers-svg';import { copyCodePlugin } from './code-block';import { advancedBlocks } from './cards';-// @ts-expect-error no types provided-import underline from 'markdown-it-underline';+import underline from './underline';import highlight from 'markdown-it-highlightjs';// @ts-expect-error no types providedimport mark from 'markdown-it-mark';diff --git a/frontend/app/helpers/markdown/underline.ts b/frontend/app/helpers/markdown/underline.tsnew file mode 100644index 00000000..3a3f6106--- /dev/null+++ b/frontend/app/helpers/markdown/underline.ts@@ -0,0 +1,17 @@+import type { Options } from 'markdown-it';+import type MarkdownIt from 'markdown-it';+import type Renderer from 'markdown-it/lib/renderer.mjs';+import type Token from 'markdown-it/lib/token.mjs';++export default function markdownItUnderline(md: MarkdownIt) {+ function renderEm(tokens: Token[], idx: number, opts: Options, _: unknown, slf: Renderer) {+ const token = tokens[idx];+ if (token?.markup === '__') {+ token.tag = 'u';+ }+ return slf.renderToken(tokens, idx, opts);+ }++ md.renderer.rules.strong_open = renderEm;+ md.renderer.rules.strong_close = renderEm;+}diff --git a/frontend/bun.lock b/frontend/bun.lockindex 0f7f7c01..047b6011 100644--- a/frontend/bun.lock+++ b/frontend/bun.lock@@ -30,7 +30,6 @@"markdown-it-container": "^4.0.0","markdown-it-highlightjs": "^4.3.0","markdown-it-mark": "^4.0.0",- "markdown-it-underline": "^1.0.1","nuxt": "^4.3.1","pdfjs-dist": "^5.4.624","pinia": "^3.0.4",@@ -1682,8 +1681,6 @@"markdown-it-mark": ["[email protected]", "", {}, "sha512-YLhzaOsU9THO/cal0lUjfMjrqSMPjjyjChYM7oyj4DnyaXEzA8gnW6cVJeyCrCVeyesrY2PlEdUYJSPFYL4Nkg=="],- "markdown-it-underline": ["[email protected]", "", {}, "sha512-J597ni39vPHIH1ONVZoDvQKUUXkOqoB93bm6Fc/5Deu6XaWMXrT0xf2m2r9qZCA8dncWJ5V8d5PyGkpmQuy/vg=="],-"math-intrinsics": ["[email protected]", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],"mathml-tag-names": ["[email protected]", "", {}, "sha512-aa6AU2Pcx0VP/XWnh8IGL0SYSgQHDT6Ucror2j2mXeFAlN3ahaNs8EZtG1YiticMkSLj3Gt6VPFfZogt7G5iFQ=="],diff --git a/frontend/package.json b/frontend/package.jsonindex a3aaba39..5a624908 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -43,7 +43,6 @@"markdown-it-container": "^4.0.0","markdown-it-highlightjs": "^4.3.0","markdown-it-mark": "^4.0.0",- "markdown-it-underline": "^1.0.1","nuxt": "^4.3.1","pdfjs-dist": "^5.4.624","pinia": "^3.0.4",