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

incorrect parse for string that is a mixture of markdown and html #180

Closed
1 task done
marwakharbech opened this issue Oct 15, 2019 · 1 comment
Closed
1 task done
Labels
cmark Issues in the underlying cmark lib

Comments

@marwakharbech
Copy link

marwakharbech commented Oct 15, 2019

Please help prevent duplicate issues before submitting a new one:

  • I've searched other open/closed issues for duplicates before opening up this new issue.

Report

A string that has both markdown and html in it, isn't parsed correctly. the markdown was ignored.

What did you do?


let myText = "#Taxation \n <br \/><img style=\"width: 100%;\" src=\"https:\/\/somewebsite.com\/img\/25\/header_taxation.jpg\" \/><br \/>Payments <br \/><a class=\"btn\" style=\"color:white;font-weight:bold;background-color:#67ae3c\" target=\"_blank\" href=\"https:\/\/somewebsite.com\"><span style=\"padding:5px\">PAY NOW<\/span><\/a>" let down = Down(markdownString: urlString) guard let html = try? down.toHTML(.unsafe) else { return } print("Taxation text", html)

What did you expect to happen?

ℹ it parses the markdown into html

What happened instead?

Taxation text <p>#Taxation<br /> <br /><img style="width: 100%;" src="https://uat-magog.bciti.info/img/25/header_taxation.jpg" /><br />Paiements électroniques par internet <br /><a class="btn" style="color:white;font-weight:bold;background-color:#67ae3c" target="_blank" href="https://transphere.acceo.com/magog/#/U3001"><span style="padding:5px">EFFECTUER UN PAIEMENT MAINTENANT</span></a></p>

@iwasrobbed
Copy link
Collaborator

Hi @marwakharbech 👋 If you feel there's a rendering error in cmark (the rendering engine used), please file it in the upstream repo: https://github.com/commonmark/cmark/issues

We're happy to update here once it's resolved. Thanks!

@iwasrobbed iwasrobbed added the cmark Issues in the underlying cmark lib label Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmark Issues in the underlying cmark lib
Projects
None yet
Development

No branches or pull requests

2 participants