ticket id
000039
status
resolved
priority
???
assigned to
Waylan
Reported by: Kang Seonghoon
Component:

PHP Markdown Extra has a support for Markdown syntax in HTML tags, like this:

<div markdown="1">
**Tom** and *Jerry*
</div>

I'm not sure that this feature can be handled with extensions; even though if it can, it is very convenient to add it to standard distribution. (I think having explicit inline notation, like markdown="inline", may be also useful, but I'm not confident about it ;)

Comments:

By Waylan on July 26, 2009

I would like to see this as well. In thinking about this a few times in the past, the solution lies in the preprocessor that removes all raw html. It would be easy to replace the existing preprocessor with a new one in an extension. However, the challenge is writing the new one. I just haven't taken the time to dig in on this yet.

To summarize, the replacement preprocessor should behave differently when the markdown=1 attribute is set. For example, given the following document:

Paragraph one.

<div markdown="1">
**Tom** and *Jerry*
</div>

Paragraph two

The current preprocessor would replace the html with a placeholder (storing the raw html in the htmlStash) like this:

Paragraph one.

placeholder_1

Paragraph two

Then after parsing the document, the placeholder is swapped out for the rawhtml. However, the new preprocessor should instead remove the rawhtml something like this:

Paragraph one.

placeholder_1
**Tom** and *Jerry*
placeholder_2

Paragraph two

The document would get parsed and the raw html would be swapped back in (with the markdown=1 attribute removed) and that would be it.

Anyone is welcome to submit working code. If you would like to discuss it further, it would be better to take the discussion to the list.

Resolution

fixed

Powered by Sputnik | XHTML 1.1