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

Feature request: Comply with CommonMark specification #48

Open
getreu opened this issue Aug 28, 2021 · 1 comment
Open

Feature request: Comply with CommonMark specification #48

getreu opened this issue Aug 28, 2021 · 1 comment

Comments

@getreu
Copy link

getreu commented Aug 28, 2021

Your library looks very promising. Unfortunately I can not use it because:

  1. html2text's output is not sufficiently CommonMark compliant yet,
  2. the HTML's metadata is not converted into a YAML metadata block (see pandoc's yaml_metadata_block)

Let me explain my use case more in detail: I tested if I could replace in my toolchain:

pandoc --standalone -f html -t markdown_strict+yaml_metadata_block+pipe_tables

with:

html2text

This would allow me to do this:

curl $(xclip -o)| thml2text | tp-note

and even integrate your library into tp-note. Then the above would look like this:

curl $(xclip -o) | tp-note

Tp-Note comes with a document viewer that renders the content with pulldown-cmark which is compliant with the CommonMark specification.

As the de facto official specification for Markdown is CommonMark, making Html2text compatible with it, would open a wider range of use cases (mine included).
Another advantage: CommonMark has a validation test suite.

What do you think?

@jugglerchris
Copy link
Owner

Hi,

As you've noticed the text output is currently inspired by markdown rather than trying to be actually valid markdown.

However I do like the idea of a full markdown output mode, and CommonMark would seem to be a good choice. (I don't think I'd want markdown to be the default for the executable, but it'd be fine to add an option html2text --md or even a separate example program html2md).

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

No branches or pull requests

2 participants