The markdown code does not handle html5 block level elements. For example, try the section module. You can input markup like:

<section>
  <p>
    foo
  </p>
</section>

and get output like:

<section></section>
<p>
  foo
<p>

This is due to the hardcoding of block level elements in the parser and not being up to date for html5. Core ran into this same issue that was recently fixed in #1280522: _filter_autop (line break converter) does not recognize html5 block level elements.

A patch is coming.....

Comments

mfer’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

This adds the html5 block level elements. You can either use the patch or there is a sandbox git repo with the commit at http://drupalcode.org/sandbox/mfer/1366266.git.

wim leers’s picture

@mfer: I think somebody (Acquia?) should take over the maintainership of this module; it doesn't look like the original maintainers will step up to do this. Also note that #1439150: Use new version of PHP Markdown library because the old version is not compatible with PHP 5.3 is fairly critical…

barraponto’s picture

Status: Needs review » Postponed

This is actually a patch for the Markdown library, which is mantained in github by Michel F. I forked and created a pull request. See https://github.com/michelf/php-markdown/pull/25

I want to see this committed, but it should be committed there. See #1532380: Load Markdown library with Libraries API 2 as well.

Taxoman’s picture

Marked #684554: Creates invalid HTML with preformatted blocks. as a duplicate of this issue.
(that one includes a patch as well)

frjo’s picture

Status: Postponed » Closed (duplicate)