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

Fix: preserve newlines in stream output rendered with ansithml #10

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

bevzzz
Copy link
Owner

@bevzzz bevzzz commented Jan 30, 2024

Unlike other HTML-rendering packages (chroma or goldmark), ansihtml does not wrap its output in <pre> tags, so newline characters \n are ignored in the HTML output.

This fix only applies to adapters.AnsiHtml and not to the broader extension.NewStream, because this is specific to ansihtml -- other stream renderers may already render the contents as pre-formatted text, or may want to display it altogether differently.


Added an executable example to quickly get the feeling for what nb is capable of and how it can be extended.

@bevzzz bevzzz merged commit a7c6647 into main Jan 30, 2024
1 check passed
@bevzzz bevzzz deleted the fix/preformatted-stream branch January 30, 2024 20:00
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.

1 participant