-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add option to display spaces #51
Comments
@the-duck having a toggle to preserve spaces seems reasonable. maybe outputting it as an html entity (` ') is a better option than a span element. It's related to the existing configuration option for preserving newlines. (https://github.com/rburns/ansi-to-html/blob/master/README.md#options) It would be tempting to preserve spaces and newlines in one config key. Though, the Possibly the existing |
Or how about Just in case one wishes XML support, Am eager to have an option to auto-generate CLI docs (using |
Either of those solutions are likely fine. (three config keys, or two). I struggle to imagine a scenario where you would want spaces preserved, but not newlines, or the opposite. I guess a whitespace key would have to take into account not only spaces and newlines, but also other whitespace characters like tabs. Makes me think |
In my PR #57 , I've just added a |
Though of course whatever API you prefer--just demoing the idea... |
Hi,
I know html does not take into account spaces in text, but sometimes ansi text only displays correctly when we include spaces.
I needed to display log info in html, so I added a 'spaces' option that replaces spaces with 'span' tags that have a width of 0.6em. Implementation is pretty easy, but it's also pretty much hacking, which is why I'm not doing a pull request.
But do you think that may be a good feature ? And would there be a better way to do it?
The text was updated successfully, but these errors were encountered: