Repository navigation
Accept emboldened man page overstrikes - #473
Merged
Merged
Conversation
Reproduces #472. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old pod2man pages say ".bd B 3", and groff 1.22.4 then strikes bold chars four times: 'x<x<x<x'. We used to only accept 'x<x', so the extra backspaces showed up on screen. Fixes #472. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Captured from an Ubuntu 22.04 container rendering .bd B/I/BI pages. Replaces the made-up 3-5 strike loops with the real bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
grotty in groff 1.22.4 repeats the whole overstruck cell, separated by a backspace, for fonts a man page emboldens using ".bd". Swallow such repeats so they render like the plain cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'_<_<_<_' used to match bold underline first, leaving a trailing '<_' unparsed. Seen in "system_var" in the getconf man page on Ubuntu 22.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'x<x<x<x' is two 'x<x' cells separated by a backspace, which consumeEmboldened() already handles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A flag does the job of the two extra states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nment The first two fail: the '_' guard in consumeBoldUnderline() breaks plain bold underlined underscores, and the heading parser accepts odd strike counts the tokenizer doesn't. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plain bold underlined underscore lost its underline and got a stray '<' since the guard also caught it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the heading state machine with consumeEmboldened(consumeBold), so headings accept exactly what the tokenizer accepts. This fixes odd strike counts like 'N<N<N' being rendered as a heading while search saw the backspaces, misaligning search hits. An up front check makes non-heading lines faster to reject. Heading lines are slower to parse than before since the consumers allocate, but there are only a few of those on screen at a time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #472.
Old pod2man man pages ask for artificial emboldening with
.bd B 3. groff 1.22.4 (Ubuntu 22.04) then repeats each overstruck cell, separated by a backspace, for examplex<x<x<xfor a boldx(<is backspace). moor only accepted the plain forms, so the extra backspaces showed up on screen as red<. groff 1.23 doesn't do this, which is why newer systems don't see the problem.Changes:
consumeEmboldened()wraps each overstrike consumer (bold, underline, bold underline, bullet) and swallows backspace separated repeats of the same cell. Repeats render just like the plain cell._<_<_<_(an emboldened bold underscore, as in "system_var" in the getconf page) is parsed as bold. A plain bold underlined_<_<_still parses as bold underline.BenchmarkRenderLinesshows no change.The test cases are exact byte sequences captured from groff 1.22.4 in an Ubuntu 22.04 container, rendering the reporter's getconf page plus a small test page using
.bdon the B, I and BI fonts. The tests also check that search sees the same text as what's on screen.🤖 Generated with Claude Code