WordPress.org

Ready to get started?Download WordPress

Forums

WP-Markdown
Breaks paragraphs (17 posts)

  1. lesslazy
    Member
    Posted 1 year ago #

    This is a great plugin, thanks!

    However, when saving existing posts for the first time with this plugin it breaks the paragraphs.

    http://wordpress.org/extend/plugins/wp-markdown/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi hyptedtext, sorry for the delayed response - for some reason I wasn't notified of this post.

    In what way does it break paragraphs? Does it strip them out?

  3. lesslazy
    Member
    Posted 1 year ago #

    Something like that. Sorry I forget exactly what it did.

  4. ChrisOBrien
    Member
    Posted 1 year ago #

    Hi Stephen,
    So I am having a problem that might sound like this one. I'm not sure if my problem is hypedtext's problem, but I didn't want to create unnecessary threads...

    The line breaks (two spaces at the end of a line) do not seem to be transferring into a post preview page. The blog summary page has all the line jumbled, but when I click the "read more" link, the blog post contains the line breaks. If I edit the post, the two spaces at the end of the line are stripped and not in the editor.

    Not sure if I am explaining this well. An example is here:
    preview page: http://www.christopherobrien.net/category/blog/
    main blog entry: http://www.christopherobrien.net/a-daring-new-world/

    I was sort of thinking this might be the wordpress theme causing the problem, but the fact that the two spaces at the end of the line are being stripped has me guessing about the plug-in.

    Any help insight would be greatly appreciated.
    (Using 3.4.2 WordPress and 1.1.5 wp-markdown)

  5. mnmcdonald
    Member
    Posted 1 year ago #

    For some reason when I try to do the double space return for a line break it's not registering. This doesn't work in either posts or pages.

  6. jj0b
    Member
    Posted 1 year ago #

    I am also having an issue where line breaks/white space are not being respected. They show up fine in the preview below the editor but do not get included on the actual post or page.

    Other elements do work on the post and page but some others do not. For example code blocks show up fine as do bold and italics but titles do not work.

  7. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mnmcdonald - sorry I've take a while to get back to you. This isn't a bug. The content on the front of your site is an excerpts. WordPress strips out the paragraph tags (among other things) on an excerpt. If you disable WP-Markdown and just use the TinyMCE editor you'll see that the same thing happens.

    jj0b - what are you using for headers? #, ##, ### work fine for me as do breaks/white space. Try the plug-in using the TwentyEleven theme and see if that works. If so, its something your theme is doing. If not, try disabling other plug-ins in case there is a conflict. If it still doesn't work, then let me know so I can investigate it futher.

  8. jj0b
    Member
    Posted 1 year ago #

    Thanks Stephen, you are right, things work fine with the default theme so we just need to fix our custom theme.

  9. mnmcdonald
    Member
    Posted 1 year ago #

    Howdy Stephen!

    Thanks for the reply! I haven't tested it on the front page with standard posts (good thing to keep in mind though), but where I'm seeing the issue is on a standard page. If you want to take a gander the page is:

    http://lengthyroad.com/colophon/

    Thanks for the reply and I look forward to any advice you might have!

  10. mnmcdonald
    Member
    Posted 1 year ago #

    Tested my posts...the strip they br as well.

    Correct me if I'm wrong, but to insert a blank line it should be:

    <space><space><return>

    That inserts the line break if I remember Markdown syntax correctly.

    My posts are in full format (not excerpt), so I don' think I was experiencing the issue that Chris (the poster above my original comment) was experiencing.

  11. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    I think a blank line is two returns....?

    I've had a look at your post - but I can't see anything wrong...

    You're right though that br tags are stripped. These are replaced by '\n' when being saved (as this is what WordPress expects). On output, WordPress uses wpautop to change these to paragraph tags.

    Sorry for the delay in responding, I wasn't get the email notifications for some reason...

  12. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    The part of the plug-in that removes the br tags will probably be removed in the next update. It was intended to provide support for oembed. This has proven too difficult, so oembed can only be used with shortcodes.

    The function I'm referring to is here: https://github.com/stephenh1988/WP-MarkDown/blob/master/wp-markdown.php#L245.

    If this is causing the problem, feel free to comment out lines 69 and 72 of: https://github.com/stephenh1988/WP-MarkDown/blob/1.1.5/wp-markdown.php#L69 as these will probably be removed in 1.1.6 and see if that resolves it for you.

  13. mnmcdonald
    Member
    Posted 1 year ago #

    To give you an example of what I'm trying to do, I want TWO blank lines between paragraphs of text. I cannot find a way to do this and had attributed it to the
    tags being stripped.

  14. mnmcdonald
    Member
    Posted 1 year ago #

    Commented out the lines, still can have two blank lines :(

  15. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    You're right, I've just tried myself. Reading this: http://daringfireball.net/projects/markdown/syntax#p - it seems its not part of the spec. It should probably not strip out the br tags - but after doing some tests, the culprit it seems is the HTML -> MarkDown converter.

  16. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Found the function responsible: https://github.com/stephenh1988/WP-MarkDown/blob/1.1.5/markdownify/markdownify.php

    Changing

    $this->out(" \n".$this->indent, true);

    To
    $this->out("<br>",true);

    Prevents the br tags from being stripped (on my dev version where the above functions you have commented out have been removed). But I'm not sure if this has any adverse effects, so I might not implement this change. Though I might consider adding in a filter - I'll post here with what I plan to do prior to the next release.

  17. mnmcdonald
    Member
    Posted 11 months ago #

    Wasn't sure if you made any progress or changes in this regards, but figured I would ask and see what's going on.

    EDIT: Just saw that you corrected the issue in 1.1.5! Will test and verify!

    EDIT x2: Doesn't look like it fixed it :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.