Unclosed $ delimiters would span across multiple lines, causing
protectMathPipes() to corrupt table cell delimiters in unrelated
content. Limit inline math matching to the same line to prevent
false matches.
Co-authored-by: Claude <noreply@anthropic.com>
AI-model: kimi-for-coding/k2p6
Wiki.js uses markdown-it-attrs which interprets curly braces inside
inline math ($...$) as attribute directives, stripping them from the
formula. Additionally, markdown table parsers split cells at both `|`
and `&` characters, breaking formulas containing those symbols.
This fix replaces `{`, `}`, `|`, and `&` inside math expressions with
Unicode Private Use Area placeholders during markdown parsing, then
restores them before passing to KaTeX/MathJax for rendering.
- `<E000>` / `<E001>`: temporary replacements for `{` / `}`
- `<E002>`: temporary replacement for `|` (table cell delimiter)
- `<E003>`: temporary replacement for `&` (table cell delimiter in
multiline tables, used by LaTeX cases/arrays)
The placeholder approach was chosen over HTML escaping because it
preserves LaTeX environments like `\begin{array}` that were broken
by the previous `{{}}` escaping method.
Fixes#1581Fixes#1462
Co-authored-by: Claude <noreply@anthropic.com>
AI-model: kimi-for-coding/k2p6
* First take on removing erroneous path characters
Paths should not accept trailing slashes or hashtags. This is a first attempt at nullifying those.
* Use rules to verify path before acceptance
Use Regex and rules to verify paths before acceptance
* Rules to prevent any leading or trailing slashes
* Complex slug for regex on path, but it elminates special chars
* Added yarn.lock to .gitignore
* Maybe we do want yarn.lock afterall
* Adding yarn.lock
* Move Regex pattern outside of export
When using inline math ($e^{-x^2}$) the curly braces are interpreted as
attributes by markdown-it-attrs. Since most of the times they are not
valid attributes they simply get removed.
This patch escapes the curly braces (the default attribute delimiter),
fixing the KaTeX rendering errors.
It would be nice to simply skip that rule for `katex_inline` block types
but as far as I know markdown-it-attrs doesn't have such an option.
Fixes#1581
Fix for #2062. Using token.string only captured the character at the cursor. Now using the cursor location to determine suitable search text. Also corrected syntax issue where suggestion removed opening link parenthesis.
* Fix: Fix word-wrap in markdown editor
Overwrite css-property 'work-break: normal' for '.CodeMirror-wrap
pre.CodeMirror-line', which lead to words not wrapping correctly,
with 'word-break: break-word' to properly wrap words.
* Add rule for 'p.line' under .editor-markdown-preview-content
Add 'overflow-wrap: break-word;' for line in the preview of the markdown editor, so the preview properly wraps and does not overflow.