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

unwanted br elements #33

Open
joostliketoast opened this issue Jan 18, 2017 · 1 comment
Open

unwanted br elements #33

joostliketoast opened this issue Jan 18, 2017 · 1 comment

Comments

@joostliketoast
Copy link

I am having a weird issue where the first HTML element placed in a text gets BR elements after each line and the one's following after it don't have this problem.

I hope anyone can see the problem with it, this is an excerpt from the text:

Markdown:

Deze overeenkomst tussen de Beowulf en Tolkiens werk is geen toeval: naast gevierd auteur was Tolkien namelijk ook hoogleraar Oudengels. \r\n\r\nh3. Tolkien en Oudengels\r\n\r\nIn zijn tienerjaren <div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'>\n Elektromagnetische kracht\n <i class=\"fa fa-chevron-down\"></i>\n elektromagnetische kracht\n</div>\n <div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'>\n Elektromagnetische kracht\n <i class=\"fa fa-chevron-down\"></i>\n elektromagnetische kracht\n</div>\n <div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'>\n Melkweg\n <i class=\"fa fa-chevron-down\"></i>\n melkweg test\n</div>\n werd Tolkien gegrepen door de middeleeuwse literatuur.

Rendered by RedCloth:

Deze overeenkomst tussen de Beowulf en Tolkiens werk is geen toeval: naast gevierd auteur was Tolkien namelijk ook hoogleraar Oudengels.</p>\n<h3>Tolkien en Oudengels</h3>\n<p>In zijn tienerjaren <div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'><br />\n Elektromagnetische kracht<br />\n <i class=\"fa fa-chevron-down\"></i><br />\n elektromagnetische kracht</p>\n</div>\n<div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'>\nElektromagnetische kracht\n<i class=\"fa fa-chevron-down\"></i>\nelektromagnetische kracht\n</div>\n<div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'>\nMelkweg\n<i class=\"fa fa-chevron-down\"></i>\nmelkweg test\n</div>\nwerd Tolkien gegrepen door de middeleeuwse literatuur.

Problem

Why does this first one get wrapped with br's?

<div class='lemmar' data-orig-file-line='app/cells/markdown/lemma/show.haml:1'><br />\n Elektromagnetische kracht<br />\n <i class=\"fa fa-chevron-down\"></i><br />\n elektromagnetische kracht</p>\n</div>
@joshuasiler
Copy link
Contributor

Hi. You can try turning off the hard_breaks option. Example here:

https://github.com/jgarber/redcloth/blob/f1c3076d0409a4ec0ead51190085f82ab97cf923/spec/formatters/html_no_breaks_spec.rb

Does that help?

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