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

Html tags get escaped without newlines #351

Closed
optikfluffel opened this issue Jun 16, 2020 · 6 comments
Closed

Html tags get escaped without newlines #351

optikfluffel opened this issue Jun 16, 2020 · 6 comments
Assignees

Comments

@optikfluffel
Copy link
Contributor

optikfluffel commented Jun 16, 2020

# without newlines
iex(1)> Earmark.as_html! "<mark>Earmark is awesome!</mark>"
"<p>\n  &lt;mark&gt;Earmark is awesome!&lt;/mark&gt;\n</p>\n"

# with newlines
iex(2)> Earmark.as_html! "<mark>\nEarmark is awesome!\n</mark>"
"<mark>\n  Earmark is awesome!</mark>\n"

Is this intended behaviour?

@RobertDober
Copy link
Collaborator

yes and documented I believe ;) unless I removed it, which I did

I will add this again to the docs, sorry

@RobertDober RobertDober self-assigned this Jun 16, 2020
@RobertDober RobertDober added this to the 1.4.6 milestone Jun 16, 2020
@optikfluffel
Copy link
Contributor Author

So there's also no option to enable something like this? Because I think it worked fine in earlier versions of Earmark and also works in almost any markdown tool or library I've seen so far. Github does too. (👈 <strong>)

@RobertDober
Copy link
Collaborator

RobertDober commented Jun 18, 2020

This was a deliberate design decision taken by @pragdave, I am not sure this is on my radar now, given the open issues.

Given GFM I am striving to better supporting pure autolinks and lists (which are still a pain) but I fail to see the value of this particular feature.

Now there are lots and lots of things I do not see 😉 and if you can make a case for this feature I might put it on my backlog, but right now I am not in favor at all.

@RobertDober
Copy link
Collaborator

Oh and I forgot to explain, yes the parser was less strict on this in recent versions but that was more by accident.

@optikfluffel
Copy link
Contributor Author

Ok then, sorry to bother you.

@RobertDober
Copy link
Collaborator

RobertDober commented Jun 18, 2020

You did not bother me and I appologize if I gave you that impression, just being honest concerning my priorities.

I reopen this because it shall be documented so your ticket certainly has value.

Again sorry if I did not communicate well on this one.

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

2 participants