Skip to content

Commit

Permalink
Don't allow square brackets inside lang attribute so double square br…
Browse files Browse the repository at this point in the history
…ackets are interpreted like Textile 2 and RedCloth 3. [#101 state:resolved]
  • Loading branch information
jgarber committed Jan 29, 2009
1 parent 9761708 commit b753dc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_attributes.rl
Expand Up @@ -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 )+ ;

Expand Down
6 changes: 5 additions & 1 deletion test/basic.yml
Expand Up @@ -915,4 +915,8 @@ in: |-
html: |-
<p>Just some <em>_</em> text</p>
<hr />
<p>Some more text.</p>
<p>Some more text.</p>
---
name: lang attribute cannot contain square brackets
in: "some @[[code]]@"
html: "<p>some <code>[[code]]</code></p>"

0 comments on commit b753dc6

Please sign in to comment.