WordPress.org

Support

Support » Plugins and Hacks » WP-Markdown » [Plugin: WP-Markdown] Breaks paragraphs

[Plugin: WP-Markdown] Breaks paragraphs

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Stephen Harris

    @stephenh1988

    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?

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

    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)

    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.

    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.

    Plugin Author Stephen Harris

    @stephenh1988

    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.

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

    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!

    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.

    Plugin Author Stephen Harris

    @stephenh1988

    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…

    Plugin Author Stephen Harris

    @stephenh1988

    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.

    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.

    Commented out the lines, still can have two blank lines 🙁

    Plugin Author Stephen Harris

    @stephenh1988

    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.

    Plugin Author Stephen Harris

    @stephenh1988

    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.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Plugin: WP-Markdown] Breaks paragraphs’ is closed to new replies.
Skip to toolbar