Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors, links, and strikeout #28

Merged
merged 3 commits into from
Mar 16, 2024
Merged

Colors, links, and strikeout #28

merged 3 commits into from
Mar 16, 2024

Conversation

silby
Copy link
Contributor

@silby silby commented Mar 12, 2024

Few more things as I work in parallel on the ANSI writer, which I think I will be able to send an initial PR for Real Soon Now.

Colors and strikeouts are fairly straightforward. Link support is a little bit more interesting but barely. Both colors and links could get more complicated internally but I don't think I'm setting us up for an external API break.

The Attr constructor grows a field for a link target, which is just a Maybe Text for the time being. We deem nested links to be illegal, like HTML, and so the rendering state only has to keep track of one link at a time. When rendering to ANSI, we use OSC8 to include the link in the output.

OSC8 links support an "id" parameter which tells terminals to treat discontiguous linked text spans as being "the same" link, for mouseover purposes. Our code could grow to support this.

@silby silby mentioned this pull request Mar 12, 2024
silby added 3 commits March 15, 2024 13:56
The `Attr` constructor grows a field for a link target, which is just a
`Maybe Text` for the time being. We deem nested links to be illegal,
like HTML, and so the rendering state only has to keep track of one link
at a time. When rendering to ANSI, we use OSC8 to include the link in
the output.

OSC8 links support an "id" parameter which tells terminals to treat
discontiguous linked text spans as being "the same" link, for mouseover
purposes. Our code could grow to support this.
@silby
Copy link
Contributor Author

silby commented Mar 15, 2024

Rebased.

@jgm jgm merged commit 796c5c8 into jgm:master Mar 16, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants