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

Property based test based on markdown-it (commonmark). #406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zombiecalypse
Copy link

@zombiecalypse zombiecalypse commented Mar 26, 2022

Note that the test is currently failing, so merge with caution

This change checks that

markdown_it.render(turndown.render(html)) ~ html

and it currently finds various corner-cases:

  • "<em>foo<br/></em>bar" => "_foo \n_bar" => "_foo<br/>_bar"
  • "<h1>foo<br/></h1>bar" => "# foo \nbar" => "<h1>foo</h1>bar"
  • "<em>foo</em>bar" => "_foo_bar" => "_foo_bar"
  • "<em><em>foo</em></em>" => "__foo__" => "<strong>foo</strong>"
  • ...

The test should be easy to extend to other scenarios that may prove to be problematic.

**Note that the test is currently failing, so merge with caution**

This change checks that

markdown_it.render(turndown.render(html)) ~ html

and it currently finds various corner-cases:

* "<em>foo<br/></em>bar" => "_foo  \n_bar" => "_foo<br/>_bar"
*  "<h1>foo<br/></h1>bar" => "# foo  \nbar" => "<h1>foo</h1>bar"
* "<em>foo</em>bar" => "_foo_bar" => "_foo_bar"
* "<em><em>foo</em></em>" => "__foo__" => "<strong>foo</strong>"
* ...

The test should be easy to extend to other scenarios that may prove to be problematic.
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