-
Notifications
You must be signed in to change notification settings - Fork 64
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
Figure out what to do with HTML #3
Comments
@PerBothner Thanks, that's very cool, but we'll still need to figure out how to support other terminal emulators. At least, we must limit the special DomTerm escape codes to DomTerm and not use them on other emulators. Is there a way to detect whether a program runs in DomTerm? Some environment variable perhaps? |
As I mentioned in issue #12, the quick-and-dirty (and probably good enough) way is to check for a For a more robust test, see this discussion. |
@PerBothner Thanks, I read your comment there right after I wrote the answer 🙈 |
This feature would be handy to parse out comments, as most markdown viewers/converters do (e.g. pandoc). If you're interested in filtering out (html) comments specifically I could open up a separate issue tho. |
Render it with w3m? |
No. |
I'm not sure what the aversion is to using But if you don't want to render any html, it would be nice to at least handle the block below:
Centered images are often the only HTML in markdown documents such as the README.md of a project. Blocks like the above are quite common in GitHub markdown files even though the align attribute has been deprecated since 1997. Then just print any other HTML as normal. |
I don't think w3m would work well, so I'll not do it myself. You say it doesn't have image support so it wouldn't even fix the one case you're interested in would it? But go ahead and make a pull request with a prototype implementation and we can try it and see whether it's a viable solution. In any case it won't happen if you don't do it; that's why there's a "help wanted" label 🤷♀️ |
w3m works only on Xorg and not with all terminal emulators |
I am wondering if conceptually using something like html2text or html2markdown would make some sense? Yes, we would need to rewrite the code in rust, but would the concept work, of identifying the HTML block, feed it to the converter, and then feed the output back into your markdown formatter. We can start small by processing some simple constructs at first. |
Closing this, because I don't intend to do anything about HTML any time soon. Pull requests are welcome. |
No description provided.
The text was updated successfully, but these errors were encountered: