Browse Source

regex clustered

master
Silberengel 10 months ago
parent
commit
b4aa734dd6
  1. 3
      src/lib/utils/markdown/advancedMarkdownParser.ts

3
src/lib/utils/markdown/advancedMarkdownParser.ts

@ -15,6 +15,7 @@ const INLINE_CODE_REGEX = /`([^`\n]+)`/g; @@ -15,6 +15,7 @@ const INLINE_CODE_REGEX = /`([^`\n]+)`/g;
const HORIZONTAL_RULE_REGEX = /^(?:[-*_]\s*){3,}$/gm;
const FOOTNOTE_REFERENCE_REGEX = /\[\^([^\]]+)\]/g;
const FOOTNOTE_DEFINITION_REGEX = /^\[\^([^\]]+)\]:\s*(.+)$/gm;
const CODE_BLOCK_REGEX = /^```(\w*)$/;
/**
* Process headings (both styles)
@ -222,7 +223,7 @@ function processCodeBlocks(text: string): { text: string; blocks: Map<string, st @@ -222,7 +223,7 @@ function processCodeBlocks(text: string): { text: string; blocks: Map<string, st
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const codeBlockStart = line.match(/^```(\w*)$/);
const codeBlockStart = line.match(CODE_BLOCK_REGEX);
if (codeBlockStart) {
if (!inCodeBlock) {

Loading…
Cancel
Save