Skip to content

[pull] master from ruby:master#114

Merged
pull[bot] merged 2 commits intosysfce2:masterfrom
ruby:master
Jan 1, 2026
Merged

[pull] master from ruby:master#114
pull[bot] merged 2 commits intosysfce2:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Jan 1, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tompng and others added 2 commits January 1, 2026 22:13
)

The logic of newline handling to make html `<span>` tag pretty does not
need to be restricted to comment token.
Remove comment-specific condition and make it simple.

### What this code is doing
Moves trailing `"\n"` outside of closing `</span>` tag to make generated
HTML pretty.
```html
<pre>
<span># comment1
</span><span># comment2
<span><span>42</span>
</pre>
```
↓
```html
<pre>
<span># comment1</span>
<span># comment2</span>
<span>42</span>
</pre>
```

### Background
In most case, only `:on_comment` token (and weird percent literal string
token) might end with `"\n"` because `RDoc::Parser::Ruby` has
token-squashing.
I'm writing a new syntax highlighter for RDoc and want to make this
pretty-html generation applied to other tokens too.
Removing token-squashing will generate more tokens that ends with
`"\n"`.
### Before

<img width="110" height="38" alt="Screenshot 2025-12-31 at 23 44 19"
src="https://github.com/user-attachments/assets/43819b7d-0e87-44f7-9ab8-51ce53e2e50a"
/>

### After

<img width="121" height="31" alt="Screenshot 2025-12-31 at 23 43 58"
src="https://github.com/user-attachments/assets/a08919cb-81b4-4092-bd02-c10fbd2852c8"
/>
@pull pull bot locked and limited conversation to collaborators Jan 1, 2026
@pull pull bot added the ⤵️ pull label Jan 1, 2026
@pull pull bot merged commit bd9cada into sysfce2:master Jan 1, 2026
4 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants