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

Adding an HTML to Markdown parser/converter (html2md) #240

Closed
AvtechScientific opened this issue Feb 12, 2024 · 5 comments
Closed

Adding an HTML to Markdown parser/converter (html2md) #240

AvtechScientific opened this issue Feb 12, 2024 · 5 comments

Comments

@AvtechScientific
Copy link

Please add also an HTML to Markdown parser/converter (html2md) and thank you for the great software!

@step-
Copy link
Contributor

step- commented Feb 12, 2024

This same request came up not too long ago: #180.

@ec1oud
Copy link
Contributor

ec1oud commented Feb 13, 2024

That sounds complicated (because HTML is complicated, in general), unless you mean that only a subset should be supported. But if you have a use for Qt for some other purpose (typically for a portable GUI), you can use https://doc.qt.io/qt-6/qtextdocument.html#setHtml and then https://doc.qt.io/qt-6/qtextdocument.html#toMarkdown. Qt's HTML parser also only supports a subset. But it works ok for writing a wysiwyg "rich text" editor or viewer.

If other libraries already do this conversion, why duplicate effort? A comment on #180 does indeed link to another alternative (which I haven't tried). There are also plenty of xml parsers already, which could be pressed into service for this purpose.

@AvtechScientific
Copy link
Author

AvtechScientific commented Feb 13, 2024 via email

@step-
Copy link
Contributor

step- commented Feb 13, 2024

An alternative html to markdown converter is pandoc -f html -t markdown_strict, with many option to tune the conversion process.

@mity
Copy link
Owner

mity commented Feb 17, 2024

If anybody wants to contribute such code, I'm open to consider incorporating it into the tree. But I have no plans working on this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants