More markdown enhancements.

This commit is contained in:
Yaro Kasear 2025-10-21 10:19:26 -05:00
parent 8d26d5b084
commit 6357e5794f
2 changed files with 11 additions and 0 deletions

View file

@ -56,6 +56,9 @@
for (const t of container.querySelectorAll('table')) { for (const t of container.querySelectorAll('table')) {
t.classList.add('table', 'table-sm', 'table-striped', 'table-bordered'); t.classList.add('table', 'table-sm', 'table-striped', 'table-bordered');
} }
for (const t of container.querySelectorAll('blockquote')) {
t.classList.add('blockquote', 'border-start', 'border-5', 'border-success', 'mt-3', 'ps-3');
}
} }
function changeMode() { function changeMode() {

View file

@ -91,11 +91,19 @@
} }
} }
function enhanceBlockquotes(root) {
if (!root) return;
for (const t of root.querySelectorAll('blockquote')) {
t.classList.add('blockquote', 'border-start', 'border-5', 'border-success', 'mt-3', 'ps-3');
}
}
function renderHTML(el, md) { function renderHTML(el, md) {
if (!el) return; if (!el) return;
el.innerHTML = renderMarkdown(md); el.innerHTML = renderMarkdown(md);
enhanceLinks(el); enhanceLinks(el);
enhanceTables(el); enhanceTables(el);
enhanceBlockquotes(el);
} }
function getMarkdown(id) { function getMarkdown(id) {