public
Description: RedCloth is a Ruby library for converting Textile into HTML.
Homepage: http://code.whytheluckystiff.net/redcloth/
Clone URL: git://github.com/jgarber/redcloth.git
Click here to lend your support to: redcloth and make a donation at www.pledgie.com !
Fixed lines starting with dashes being recognized as a definition list 
when there were no definitions. [#21 state:resolved]
jgarber (author)
Thu Jul 24 12:36:45 -0700 2008
commit  a68fb74c97ba51ddb9a3de56840ea15d52aafad9
tree    3b16f594389064594011770f151aa39f14a8a0b0
parent  bb00efb8a53fefd68a38755c715eb2cd9687457f
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 = Edge
0
 
0
+* Fixed lines starting with dashes being recognized as a definition list when there were no definitions.
0
 * Created alias RedCloth.rb so Rails 2.1 gem dependency works on case-sensitive operating systems  .
0
 * Fixed parsing sentences that had two em dashes surrounded by spaces from becoming del phrases. #19
0
 * Fixed links including prior quoted phrases. #17
...
40
41
42
43
 
44
45
 
46
47
48
...
285
286
287
288
 
289
290
291
292
293
294
 
295
296
297
...
312
313
314
315
 
316
317
318
...
40
41
42
 
43
44
45
46
47
48
49
...
286
287
288
 
289
290
291
292
293
294
 
295
296
297
298
...
313
314
315
 
316
317
318
319
0
@@ -40,9 +40,10 @@ int SYM_escape_preformatted;
0
   ul = "*" %{nest++; list_type = "ul";};
0
   ol = "#" %{nest++; list_type = "ol";};
0
   list_start = ( ( ul | ol )+ N A C :> " "+ ) >{nest = 0;} ;
0
- dl_start = "-" . " "+ ;
0
+ dt_start = "-" . " "+ ;
0
   dd_start = ":=" ;
0
   long_dd = dd_start " "* LF %{ ADD_BLOCK(); ASET(type, dd); } any+ >A %{ TRANSFORM(text) } :>> "=:" ;
0
+ dl_start = (dt_start mtext (LF dt_start mtext)* " "* dd_start) ;
0
   blank_line = LF;
0
   link_alias = ( "[" >{ ASET(type, ignore) } %A phrase %T "]" %A uri %{ STORE_URL(href); } ) ;
0
   
0
@@ -285,13 +286,13 @@ int SYM_escape_preformatted;
0
   *|;
0
 
0
   list := |*
0
- LF list_start { ADD_BLOCK(); LIST_ITEM(); };
0
+ LF list_start { ADD_BLOCK(); LIST_ITEM(); };
0
     block_end { ADD_BLOCK(); nest = 0; LIST_CLOSE(); fgoto main; };
0
     default => cat;
0
   *|;
0
 
0
   dl := |*
0
- LF dl_start { ADD_BLOCK(); ASET(type, dt); };
0
+ LF dt_start { ADD_BLOCK(); ASET(type, dt); };
0
     dd_start { ADD_BLOCK(); ASET(type, dd); };
0
     long_dd { INLINE(html, dd); };
0
     block_end { ADD_BLOCK(); INLINE(html, dl_close); fgoto main; };
0
@@ -312,7 +313,7 @@ int SYM_escape_preformatted;
0
     block_start { fgoto block; };
0
     footnote_start { fgoto footnote; };
0
     list_start { list_layout = rb_ary_new(); LIST_ITEM(); fgoto list; };
0
- dl_start { INLINE(html, dl_open); ASET(type, dt); fgoto dl; };
0
+ dl_start { p = ts; INLINE(html, dl_open); ASET(type, dt); fgoto dl; };
0
     table { INLINE(table, table_close); DONE(table); fgoto block; };
0
     link_alias { rb_hash_aset(refs_found, rb_hash_aref(regs, ID2SYM(rb_intern("text"))), rb_hash_aref(regs, ID2SYM(rb_intern("href")))); DONE(block); };
0
     aligned_image { rb_hash_aset(regs, ID2SYM(rb_intern("type")), plain_block); fgoto block; };
...
48
49
50
 
 
 
 
 
 
 
 
 
 
 
51
52
53
...
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
0
@@ -48,6 +48,17 @@ html: |-
0
     <dd>woven threads</dd>
0
   </dl>
0
 ---
0
+name: not a definition list
0
+desc: a definition list with no definitions is not a definition list
0
+in: |-
0
+ - textile
0
+ - fabric
0
+ - cloth
0
+html: |-
0
+ <p>- textile<br />
0
+ - fabric<br />
0
+ - cloth</p>
0
+---
0
 name: long definition list
0
 in: |-
0
   here is a long definition

Comments

    No one has commented yet.