| | ], |
| | 'markdown' => [ |
| | - 'comment' => '/()/s', |
| | - 'keyword' => '/^(#{1,6}\s+.*)$/m', |
| | - 'string' => '/(\*\*.*?\*\*|__.*?__|\*.*?\*|_.*?_)/', |
| | - 'variable' => '/(\[.*?\]\(.*?\))/', |
| | - 'number' => '/^(\s*[-*+]\s|\s*\d+\.\s)/m', |
| | + 'comment' => '/(```[\s\S]*?```|~~~[\s\S]*?~~~)/', // Fenced code blocks |
| | + 'keyword' => '/^(#{1,6})(?=\s)/m', // Heading markers only (# ## ###) |
| | + 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', // Bold text |
| | + 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', // Italic text (single * or _) |
| | + 'function' => '/(`[^`\n]+`)/', // Inline code |
| | + 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', // Links [text](url) |
| | + 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', // List markers |
| | ], |
| | 'rmd' => [ |
| | - 'comment' => '/()/s', |
| | - 'keyword' => '/^(#{1,6}\s+.*)$/m', |
| | - 'variable' => '/(`{3}\{r.*?`{3})/s', |
| | + 'comment' => '/(```\{r[^\}]*\}[\s\S]*?```)/', // R code blocks with {r} |
| | + 'keyword' => '/^(#{1,6})(?=\s)/m', // Heading markers only |
| | + 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', // Bold text |
| | + 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', // Italic text |
| | + 'function' => '/(`[^`\n]+`)/', // Inline code |
| | + 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', // Links [text](url) |
| | + 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', // List markers |
| | ], |
| | 'r' => [ |
 |
| | } |
| | } |
| | - |
| | |