More markdown enhancements.
This commit is contained in:
parent
8d26d5b084
commit
6357e5794f
2 changed files with 11 additions and 0 deletions
|
|
@ -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() {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue