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

Line break not working #28

Closed
eric-wieser opened this issue Aug 27, 2011 · 4 comments
Closed

Line break not working #28

eric-wieser opened this issue Aug 27, 2011 · 4 comments

Comments

@eric-wieser
Copy link

The following:

This is a  
line break

Is not being correctly output as

This is a
line break

Instead, two line breaks are inserted. See http://jsfiddle.net/bgwDK/

@eric-wieser
Copy link
Author

Github is behaving incorrectly as well. From the Markdown Documentation

When you do want to insert a
break tag using Markdown, you end a line with two or more spaces, then type return.

Your code is inserting <br></br> when it should be inserting <br />

@franzwilding
Copy link

i solved it for myself a little dirty, maybe a hint for someone else:

1314: // be careful about adding whitespace here for inline elements
1315: if(tag == "br")
1316:   return "<"+ tag + tag_attrs + "/>";
1317: else
1318:   return "<"+ tag + tag_attrs + ">" + content.join( "" ) + "</" + tag + ">";

@danlec
Copy link

danlec commented Nov 28, 2011

I've observed this problem as well and fixed it with a patch similar to franzwilding's

@franzwilding
Copy link

good to hear!

thank you!

@ashb ashb closed this as completed in 1b74287 Mar 24, 2012
snowyu pushed a commit to snowyu/markdown-js that referenced this issue Mar 27, 2012
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

4 participants