diff --git a/CHANGELOG b/CHANGELOG index 7a9083ff..07a2bd14 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ === Edge +* Don't allow square brackets inside lang attribute so double square brackets are interpreted like Textile 2 and RedCloth 3. #101 + * Improve LaTeX output for tables. #96 * Fix bad parsing of bracketed image links (which would hang the interpreter in some cases). #97 diff --git a/ext/redcloth_scan/redcloth_attributes.rl b/ext/redcloth_scan/redcloth_attributes.rl index aee3b1cb..3de0fd49 100644 --- a/ext/redcloth_scan/redcloth_attributes.rl +++ b/ext/redcloth_scan/redcloth_attributes.rl @@ -8,7 +8,7 @@ machine redcloth_attributes; C2_CLAS = ( "(" ( [^)#]+ >A %{ STORE("class_buf"); } )? ("#" [^)]+ >A %{STORE("id_buf");} )? ")" ) ; - C2_LNGE = ( "[" [^\]]+ >A %{ STORE("lang_buf"); } "]" ) ; + C2_LNGE = ( "[" [^\[\]]+ >A %{ STORE("lang_buf"); } "]" ) ; C2_STYL = ( "{" [^}]+ >A %{ STORE("style_buf"); } "}" ) ; C2 = ( C2_CLAS | C2_STYL | C2_LNGE )+ ; diff --git a/test/basic.yml b/test/basic.yml index 5a926cc1..ab1683cf 100644 --- a/test/basic.yml +++ b/test/basic.yml @@ -915,4 +915,8 @@ in: |- html: |-

Just some _ text


-

Some more text.

\ No newline at end of file +

Some more text.

+--- +name: lang attribute cannot contain square brackets +in: "some @[[code]]@" +html: "

some [[code]]

" \ No newline at end of file