Repository navigation
Compare: "Take text, keep formatting" (#16823) - #16829
Merged
Merged
Conversation
Copies the reference line's plain text but keeps the tags that wrap the
current line: leading/trailing ASSA override blocks ({\an8}{\i1} ... {\i0})
and HTML <i>/<b>/<u>/<font> that open at the start and close at the end
(also when closed and reopened at a line break). Tags in the middle of the
line are dropped. Useful when one OCR got the italics right and another got
the letters right.
Available from the row's right-click menu, the inline editor and
Alt+Shift+Left. Shown only when the result differs from both the current
line and a plain "Take text".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #16823: in Compare, take the reference's plain text but keep the current line's formatting.
What it does
New Take text, keep formatting action (row right-click menu, inline editor button, Alt+Shift+Left). It strips all tags from the reference text and wraps it in the tags that wrap the current line:
{\an8}{\i1}…{\i0}, also an unclosed{\i1}…<i>,<b>,<u>,<font …>that open at the start and close at the end, including per-line italics (<i>a</i>\n<i>b</i>→<i>a\nb</i>)Tags in the middle of a line are dropped, since they can't be placed once the words differ.
<i>One</i> two <i>three</i>is not treated as an italic line.The item only shows when its result differs from both the current line and a plain "Take text". The gutter arrow and Take text work as before.
Example (from the issue)
Current:
{\i1}von derUniversityofSouthern California.{\i0}Reference:
von der University of Southern California.Result:
{\i1}von der University of Southern California.{\i0}Tests
CompareFormattingKeeperTests(new) and a view-model test inCompareEditTests. All 127 Compare tests pass. Not tried by hand in the running app.The nOCR spacing part of the issue (italic word gaps, extra spaces after "m"/"A") is not included and will be a separate PR.
🤖 Generated with Claude Code