attribute blocks for definition lists

Waylan Limberg waylan at gmail.com
Fri Jul 19 22:03:59 EDT 2013


On Mon, Jul 1, 2013 at 11:33 AM, Matthieu Codron
<codronm+markdown at gmail.com> wrote:

>

> the syntax would be

>

> term {#id}

> : definition

>


Python-Markdown already has extensions for Attribute Lists [1] and
Definition Lists [2] (both also available as part of Extra [3]).
However, due to the restriction that definition list terms can only be
on a single line (each line is a separate term), it was impossible to
assign attrs to the term. I was already special casing headers (h1-6)
for the same reason, so it wasn't too hard to adapt the code to work
with dt's also.

I just pushed a fix [4] which implements support for this syntax (you
can set any kind of attribute supported by the attr_list extension)
and it should be available in the next release of Python-Markdown
(probably 2.3.2). As always, testing/feedback is welcome.

[1]: http://pythonhosted.org/Markdown/extensions/attr_list.html
[2]: http://pythonhosted.org/Markdown/extensions/definition_lists.html
[3]:http://pythonhosted.org/Markdown/extensions/extra.html
[4]:https://github.com/waylan/Python-Markdown/commit/a9ca97325e9039de90eae29fb3d8879bc9f367f6

----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg


More information about the Markdown-Discuss mailing list