Markdown within block-level elements

jakov at gmx.at jakov at gmx.at
Fri Sep 19 07:11:37 EDT 2014


>The rule allows you to retroactively introduce Markdown to any system
>that was designed to handle HTML, without breaking any existing
>content.

> ... [further good reasons for this rule]

May I toss in an idea (I'm not sure if I stumbled upon it or thought it up myself):

For easy copy pasting, backwards compatibility etc (as others just pointed out), markdown=0 should imo be default for any HTML element. As in PHP markdown, let markdown=1 interpret inline stuff inside that element.

Then let markdown=2 make the child element inherit markdown=1 and so on, eg.:

<div markdown=2>
Inline markdown *here*.
.<div>first level child: markdown is *on*
..<div>second level child: markdown is <em>off</em> again.
..</div>
.</div>
</div>

So the concept is, that the number given will be counted down before inheriting it.

Markdown=all (or similar) would inherit through all levels. To escape inheritance, put markdown=0 there again.

To simplify things, one could also leave out the counting down thing and only have three States: off, on*, all levels*.

(* php markdown extra intelligently doesn't produce block elements where inappropriate, e.g. inside an inline element and therefore has an additional "block" feature, seehttps://michelf.ca/projects/php-markdown/extra/#markdown-attr; this should also be applicable as "all-block")

If you want to have an all markdown document, wrap it into an element with markdown=all (or all-block). However, there might be situations where you don't want to output any extra element; I'm not sure whether a pseudo-element like <markdown> (or <!-- <markdown> --> ?) would be a good solution to this.

Just an idea, I'd really like to hear your thoughts on it.

jakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20140919/eb9bb985/attachment.html>


More information about the Markdown-Discuss mailing list