Skip to content

Commit

Permalink
Allow leading spaces on lists for backward compatibility with RedClot…
Browse files Browse the repository at this point in the history
…h 3.x. [#89 state:resolved]
  • Loading branch information
jgarber committed Feb 11, 2009
1 parent 241a311 commit 2bdd829
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,5 +1,7 @@
=== Edge

* Allow leading spaces on lists for backward compatibility with RedCloth 3.x. #89

* Recognize deleted phrases when they start at the beginning of a line. #83

* Fix escaped <code> tag when it has the class attribute and is in a <pre> tag. #95
Expand Down
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_scan.rl
Expand Up @@ -30,7 +30,7 @@
ol = "#" %{nest++; list_type = "ol";};
ul_start = ( ul | ol )* ul A C :> " "+ ;
ol_start = ( ul | ol )* ol N A C :> " "+ ;
list_start = ( ul_start | ol_start ) >{nest = 0;} ;
list_start = " "* ( ul_start | ol_start ) >{nest = 0;} ;
dt_start = "-" . " "+ ;
dd_start = ":=" ;
long_dd = dd_start " "* LF %{ ADD_BLOCK(); ASET("type", "dd"); } any+ >A %{ TRANSFORM("text"); } :>> "=:" ;
Expand Down
20 changes: 19 additions & 1 deletion test/lists.yml
Expand Up @@ -280,4 +280,22 @@ html: |-
<ul>
<li>One</li>
<li>Two</li>
</ul>
</ul>
---
name: unordered list with leading spaces
in: " * notice the leading space\n * RedCloth 3.0.4 used to accept it\n * Now we do too"
html: |-
<ul>
<li>notice the leading space</li>
<li>RedCloth 3.0.4 used to accept it</li>
<li>Now we do too</li>
</ul>
---
name: ordered list with leading spaces
in: " # notice the leading space\n # RedCloth 3.0.4 used to accept it\n # Now we do too"
html: |-
<ol>
<li>notice the leading space</li>
<li>RedCloth 3.0.4 used to accept it</li>
<li>Now we do too</li>
</ol>

0 comments on commit 2bdd829

Please sign in to comment.