fix: raise citation markers and stop adjacent ones merging (#22)

This commit was merged in pull request #22.
This commit is contained in:
2026-10-07 08:19:58 +00:00
parent fcc6d26c9d
commit 0705d5ec2f
7 changed files with 103 additions and 25 deletions
@@ -67,9 +67,18 @@ would have been asked are recorded here instead.
line; a citation list is part of the answer's credibility.
- **A4. The copied conversation includes the list**, in the same form, so
provenance survives a paste into a document.
- **A5. The marker is `[1]`, not a superscript.** A superscript inside a link is
a smaller target and, at this pane width, harder to read than the bracket form
that is already the convention in most model output.
- **A5. The marker in a sentence is a superscript, and the list keeps the plain
number.** The model still writes `[1]`; the window draws it raised, as `[¹]`, and
the entry under the answer reads `[1] Title` at normal size, where scanning a list
matters more than convention. This reverses an earlier decision that markers stay
at baseline, taken on the grounds that a raised marker is a smaller target; the
user asked for the raised form after reading the first version, and the target is
the same width in practice because only the digits are raised.
- **A6. Superscripts are Unicode digits, not a `<sup>` tag.** The label of a markdown
link is plain text that no pass can break, while inline HTML inside a label asks
the sanitizer, the parser and Qt to agree about something this repository cannot
test. Digits are raised by design in every font, so the mark still reads correctly
when a font lacks the rarer glyphs and Qt falls back for them.
## Design
@@ -152,7 +161,11 @@ The pass follows the rules the rest of the pipeline already follows.
- **Prose only.** Fenced segments and code spans are skipped, using the same
machinery the maths pass uses. A `[1]` inside a snippet is text.
- **`[n]`, `[^n]` and comma lists** (`[1, 3]`) are recognised.
- **`[n]`, `[^n]`, comma lists, and runs.** `[1, 3]` is two sources inside one
marker, and `[1][2]` is two markers written touching. Both are drawn as raised
digits separated by a comma, because `¹²` reads as a single number and leaves the
reader no way to tell where one citation ends, which is a defect the first version
of this shipped with.
- **All or nothing.** A marker is linked only when every index it names is a
known source. `[1, 9]` where 9 was never seen stays exactly as written, rather
than becoming half a link.