-
Notifications
You must be signed in to change notification settings - Fork 863
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
Disable wrapping everything is a p
#156
Comments
do agree with this, it's annoying |
Same here.... wrapping in a paragraph element makes this module unusable. |
When you say wrapping everything in a
… gets turned into this … <p>The quick brown fox jumps
over the lazy dog.</p>
<p>Pack my box with five
dozen liquor jugs.</p> If so, that's just how Markdown works I'm afraid. |
If so, I suggest adding an option to get rid of it in the plugin. Usually it's annoying when I get data from my database and pass it to Currently I'm getting rid of it at the backend, remove the |
You can do this by not calling |
@ashb |
Here's a version. tree = md.markdown.parse("The quick brown fox jumps\n*over* the lazy dog.\n\nPack my box with five\ndozen liquor jugs.\n") This gives us a tree that looks like this [ 'markdown',
[ 'para',
'The quick brown fox jumps\n',
[ 'em', 'over' ],
' the lazy dog.' ],
[ 'para',
'Pack my box with five\ndozen liquor jugs.' ] ] We can remove the top level paras and keep them separated like this: tree.forEach( function(jsonml) { if (jsonml[0] == "para") { jsonml.splice(0,1) } } ) yeilding: [ 'markdown',
[ 'The quick brown fox jumps\n',
[ 'em', 'over' ],
' the lazy dog.' ],
[ 'Pack my box with five\ndozen liquor jugs.' ] ] This should give you enough to go on I hope. If you have more precise requirements let us know! |
Rendering that ends up with the text in tags, so for example: ['markdown', ['Hello World']] ends up as |
Ah, I fixed this by using lodash's |
Noting that |
Is there anyway to disable wrapping everything in a
p
The text was updated successfully, but these errors were encountered: