• Hi!

    When I make posts I include <!–more–> at an appropriate position. When using Markdown to format my posts I have noticed that the current paragraph isn’t terminated properly and has an abrupt ending at the position of the <!–more–> indicator.

    This results in invalid html with a which is never terminated.

    Is there any work around to solve this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter kentl

    (@kentl)

    >This results in invalid html with a which is never terminated.
    This line should have been:
    This results in invalid html with a >p< which is never terminated.

    Reverse the direction of the >p< arrows (as I can’t write the tag in this forum).

    Are you using the latest version of the Markdown plugin? I think this has been fixed in PHP Markdown 1.0.1.

    https://www.michelf.com/projects/php-markdown/

    The original poster’s issue appears to be resolved, although I’m experiencing a related issue with WP2.0 and PHP Markdown 1.0.1c… reference-style links defined at the end of the document don’t work with <!--more--> if only the excerpt is showing. I’m not sure this is easily fixed without changing WP (but see below for workaround). Here’s a sample Markdown post:

    blah blah blah [link][1] blah
    <!--more-->
    blah blah blah [other link][2]

    [1]: (link URI)
    [2]: (link URI)

    The problem is the the_content() (defined in wp-includes/template-functions-post.php) calls get_the_content(), which splits the original post if <!--more--> is present and there’s more than one post on the current page. After getting back the top of the post from get_the_content(), the_content() then applies filters (including markdown).

    The workaround is to move any reference link definitions used before the <!--more-->, up before the <!--more-->. Like so:

    blah blah blah [link][1] blah

    [1]: (link URI)
    <!--more-->
    blah blah blah [other link][2]

    [2]: (link URI)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Markdown <!–more–> renders invalid HTML’ is closed to new replies.