1.0.2b7 misrenders nested divs with attributes

Matt Kraai kraai at ftbfs.org
Wed May 2 03:30:04 EDT 2007


Howdy,

Joey Hess reported that Markdown 1.0.2b7 does not render the following
correctly:

<div class="inlinepage">
<div class="toggleableend">
foo
</div>
</div>

It renders it as follows:

<div class="inlinepage">
<div class="toggleableend">
foo
</div>

<p></div></p>

The problem is that it uses a backreference in the expression that it
passes to gen_extract_tagged, which is broken when Text::Balanced
wraps it in parentheses. The attached patch fixes it.

--
Matt
-------------- next part --------------
--- Markdown.pl.orig 2006-08-29 19:11:53.000000000 -0700
+++ Markdown.pl 2007-05-02 00:28:53.000000000 -0700
@@ -333,9 +336,11 @@
# before each attribute name.
[\w.:_-]+ # Attribute name
\s*=\s*
- (["']) # Attribute quoter
- .+? # Attribute value
- \1 # Closing quoter
+ (?:
+ ".+?" # "Attribute value"
+ |
+ '.+?' # 'Attribute value'
+ )
)* # Zero or more
}x;



More information about the Markdown-Discuss mailing list