Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dskripchenko/embed": minor
---

`#tags` and a document's properties (its YAML front matter, as a table) in `<dsk-markdown>`; tags kept through `<dsk-markdown-editor>`'s visual mode, the front matter as written. Runtime: ui 1.27.0, wysiwyg 0.11.0, markdown-editor 0.8.0, syntax 0.4.1.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
"@dskripchenko/diagrams": "1.3.4",
"@dskripchenko/drawio": "0.1.0",
"@dskripchenko/flow": "1.2.0",
"@dskripchenko/markdown-editor": "0.7.0",
"@dskripchenko/markdown-editor": "0.8.0",
"@dskripchenko/math": "0.1.0",
"@dskripchenko/openapi": "1.3.1",
"@dskripchenko/syntax": "0.4.0",
"@dskripchenko/ui": "1.26.1",
"@dskripchenko/wysiwyg": "0.10.1",
"@dskripchenko/syntax": "0.4.1",
"@dskripchenko/ui": "1.27.0",
"@dskripchenko/wysiwyg": "0.11.0",
"@eslint/js": "^10.0.1",
"@types/node": "^22.20.5",
"eslint": "^10.13.0",
Expand Down
76 changes: 38 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions scripts/browser-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -711,17 +711,17 @@ for (const browserName of Object.keys(browsers)) {
await page.evaluate(() => {
const box = document.createElement('section')
box.id = 'math-box'
box.innerHTML = '<dsk-markdown><script type="text/markdown">Euler: $e^{i\\pi} + 1 = 0$, ==marked==.\n\n$$\\sum_{i=1}^{n} i$$\n</script></dsk-markdown>'
box.innerHTML = '<dsk-markdown><script type="text/markdown">---\ntags: [physics]\n---\n\nEuler: $e^{i\\pi} + 1 = 0$, ==marked== #famous.\n\n$$\\sum_{i=1}^{n} i$$\n</script></dsk-markdown>'
document.body.append(box)
})
await page.waitForFunction(() => !!document.querySelector('#math-box math[display="block"]'), null, { timeout: 10000 }).catch(() => {})
const math = await page.evaluate(() => {
const box = document.querySelector('#math-box')
const out = { inline: box.querySelectorAll('math:not([display])').length, block: box.querySelectorAll('math[display="block"]').length, mark: box.querySelector('mark')?.textContent ?? null, height: box.querySelector('math[display="block"]')?.getBoundingClientRect().height ?? 0 }
const out = { inline: box.querySelectorAll('math:not([display])').length, block: box.querySelectorAll('math[display="block"]').length, mark: box.querySelector('mark')?.textContent ?? null, tags: [...box.querySelectorAll('.uid-markdown__tag')].map((t) => t.dataset.tag).join(','), props: !!box.querySelector('table.uid-markdown__props'), height: box.querySelector('math[display="block"]')?.getBoundingClientRect().height ?? 0 }
box.remove()
return out
})
check(`${tag}: <dsk-markdown> draws TeX math and highlights`, math.inline === 1 && math.block === 1 && math.mark === 'marked' && math.height > 20, JSON.stringify(math))
check(`${tag}: <dsk-markdown> draws TeX math, highlights, tags and properties`, math.inline === 1 && math.block === 1 && math.mark === 'marked' && math.height > 20 && math.tags === 'physics,famous' && math.props, JSON.stringify(math))
check(`${tag}: no console errors`, errors.length === 0, errors.slice(0, 3).join(' | '))
} catch (error) {
check(`${tag}: ran`, false, error.message.split('\n')[0])
Expand Down
Loading