[Enhancement] Improve pilcrow styling#6152
Conversation
nathanlesage
left a comment
There was a problem hiding this comment.
I'm a bit wary with regard to the overflow, did you test this extensively? I am a bit afraid this could mess with CodeMirror's line wrapping calculation, or am I just over-cautious here?
I'll be testing this over the next couple days, so I'm fine letting it sit until I can report back. But have not had any issues so far. Text wrapping is normal, and from my understanding, |
|
Okay, sounds good! First thing on my todo today is releasing 4.1.1 and then trying to convince Azure to use a new code cert, when that works I'll be less stressed as well 🙈 |
|
Last two commits handle two issues I was seeing: The line wrapping plugin was calculating in indent in narrow windows that shouldn't be there, and the issue was with the whitespace regex, which was matching on zero or more whitespace. I corrected it to require at least one whitespace character. Have not noticed any indent issues otherwise. Wide tables were causing the content window to scroll. Adding back Otherwise, haven't seen any other problems working the past two days |
* when selecting the beginning of a line of text * to the beginning of a following blank line, * then press a character to replace the text, literal * pilcrow text is added to the end of the line. * setting `user-select: none` and `pointer-events: none` * seems to solve this
4637956 to
3849427
Compare
nathanlesage
left a comment
There was a problem hiding this comment.
Found two more minor things, but this thing looks mergeable!
|
Trés bien, and merging! |
Description
This PR includes several pilcrow improvements, including no longer drawing them on code-block marker lines (```) and no longer triggering line wrapping,
Changes
Pilcrows are no longer drawn on lines for code block or pandoc div formatting marks, i.e. ``` and
:::. This was discussed in #6067Additionally, pilcrows are no longer drawn on folded lines. This prevents two pilcrows from showing up on a line when a range is folded.
Pilcrows no longer trigger wrapping to the next line. This prevents the pilcrow from wrapping by itself, ending up on the line alone. Because pilcrows may now overflow the text boundary, the
cm-content { overflow-x }CSS property was changed fromhiddentovisible.The header styling was changed so that the styling is applied to the whole line. When I migrated the code to these CSS styles, I did not realize the selecter I used,
.cm-header-*, is only applied to small runs of characters within the header, not the entire line, so some characters within a header may not receive the styling. I noticed this because pilcrows and trailing space did not.Additional information
Linewrapping and header styling:
CURRENT:
Screen.Recording.2026-01-26.at.09.43.49.mov
PR:
Screen.Recording.2026-01-26.at.09.43.17.mov
Tested on: macOS 26