pediatric-ai-scribe-v3/public/js/assistant
Daniel 2d292d12af
All checks were successful
Forgejo Android APK / Build signed APK (push) Successful in 1m58s
fix: make the markdown repairs line aware so tables and ranges survive
The earlier fix corrected two of the repair rules and left the rest with the same
flaw, and the punctuation boundary it introduced let the table case back in. A
review found the remainder.

Every repair rule inserted newlines with no idea whether it was inside a markdown
table row. A dose row such as "| Dexamethasone | 0.6 mg/kg PO (max 16 mg) - single
dose | 1 |" was split mid-row, which drops that row's citation and every row
below it out of the table. A "#" column destroyed the table outright. The rules
now skip table rows, dividers and headers entirely.

Ranges were still split in three other places: in a heading, so "### Dexamethasone
0.15 - 0.6 mg/kg" rendered as a heading reading "Dexamethasone 0.15"; after a
citation; and beside a hash, where "Room # 4" became a heading. A hyphen now
starts a list item only when a number does not follow, and a run-together heading
is recognised by the capital letter after the hashes rather than by position.

Adjacent citation merging could also cross a paragraph break, turning "[1]\n\n[2]
Vancomycin only if MRSA" into "[1, 2]Vancomycin only if MRSA" -- joining two
paragraphs and moving a citation onto a claim it never supported. Merging is now
limited to citations on the same line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 19:49:01 +02:00
..
api.js fix mobile assistant table streaming 2026-05-11 16:15:45 +02:00
citations.js fix: make the markdown repairs line aware so tables and ranges survive 2026-08-28 19:49:01 +02:00
data.js feat: diversify assistant starter prompts 2026-05-07 03:19:51 +02:00
export.js fix mobile export save actions 2026-05-10 23:56:51 +02:00
images.js Prevent citations in clinical image prompts 2026-08-28 03:23:18 +02:00
sources.js harden clinical assistant source handling 2026-05-09 19:59:04 +02:00