diff --git a/assets/js/markdown.js b/assets/js/markdown.js index bc1fdf1..85b8b32 100644 --- a/assets/js/markdown.js +++ b/assets/js/markdown.js @@ -84,18 +84,24 @@ function parseMarkdown(markdown) { return '' + text + ''; }); - // Task lists — must run before general list processing - html = html.replace(/^\s*-\s+\[x\]\s+(.+)$/gim, '
  • $1
  • '); - html = html.replace(/^\s*-\s+\[ \]\s+(.+)$/gm, '
  • $1
  • '); + // Lists — tag each item type with a placeholder, then wrap consecutive runs + html = html.replace(/^\s*\d+\.\s+(.+)$/gm, '%%OLI%%$1'); + html = html.replace(/^\s*[-*+]\s+\[x\]\s+(.+)$/gim, '%%TDI%%$1'); + html = html.replace(/^\s*[-*+]\s+\[ \]\s+(.+)$/gm, '%%TTI%%$1'); + html = html.replace(/^\s*[-*+]\s+(.+)$/gm, '%%ULI%%$1'); - // Unordered lists (- item or * item) — wrap consecutive
  • in