6 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
ebcebd4723 Unify migration locks and plugin environments, and cover compatibility boundaries 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
60df53fcf3 Merge #2316 from rudycelekli 2026-11-06 01:56:40 +08:00
Rudy Celekli
2c30cf5e1d fix(co_writer): don't italicize intra-word underscores in DOCX export
markdown_to_docx matched _..._ anywhere, so prose mentioning an identifier like
snake_case_word was exported with "case" italicized and the surrounding
underscores dropped ("snakecaseword"). Per CommonMark, _ only opens or closes
emphasis at a word boundary (unlike *, which may emphasise intra-word).

Guard the _ emphasis branch with word-boundary lookarounds, matching the
pattern already used for Anki export in deeptutor/notes/anki_export.py.
Word-bounded _italic_ is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:25:11 -05:00
RRFZ
953a6106f5 fix(co_writer): stop the Windows write lock file growing on every save
CoWriterStorage.locked() is taken by every document save, note-thread
change, proposal and review. Its Windows branch appended b"0" to the
append-mode .write.lock file before each msvcrt lock, so the file grew
by one byte per acquisition (1,000 saves: 1,000 bytes) and never shrank.

Write the byte only when the file is empty, as the other msvcrt locks
in the codebase do.
2026-10-31 22:25:42 -04:00
Bingxi Zhao (Frank)
f41f9cfe74 fix: sanitize XML text before rendering every DOCX block 2026-10-27 21:41:24 +08:00
Rudy Celekli
f008dce902 fix(co_writer): don't crash DOCX export on a literal NUL in Markdown
_add_inline_runs masks backslash escapes with the sentinel _MASK = '\x00' and
pops one saved character per sentinel in _unmask. A NUL already present in the
input collides with the sentinel but has no saved entry, so _unmask called
deque.popleft() on an empty deque and raised IndexError, aborting the entire
Word export. NUL is not valid XML text content, so strip it at the single
inline-text choke point before masking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-26 10:28:17 -04:00