File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ static AccessorFlagPair ACCESSOR_2_FLAG[] = {
3535    { "no_superscript" , MKD_NOSUPERSCRIPT  },
3636    { "no_strikethrough" , MKD_NOSTRIKETHROUGH  },
3737    { "latex" , MKD_LATEX  },
38+     { "explicitlist" , MKD_EXPLICITLIST  },
3839    { NULL , 0  }     /* sentinel */ 
3940};
4041
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ class RDiscount
7878  # Keep LaTeX inside $$ intact. 
7979  attr_accessor  :latex 
8080
81+   # Don't merge adjacent list into a single list. 
82+   attr_accessor  :explicitlist 
83+ 
8184  # Create a RDiscount Markdown processor. The +text+ argument 
8285  # should be a string containing Markdown text. Additional arguments may be 
8386  # supplied to set various processing options: 
@@ -99,6 +102,7 @@ class RDiscount
99102  # * <tt>:no_superscript</tt> - Disable superscript processing. 
100103  # * <tt>:no_strikethrough</tt> - Disable strikethrough processing. 
101104  # * <tt>:latex</tt> - Keep LaTeX inside $$ intact. 
105+   # * <tt>:explicitlist</tt> - Don't merge adjacent list into a single list. 
102106  # 
103107  def  initialize ( text ,  *extensions ) 
104108    @text   =  text 
Original file line number Diff line number Diff line change @@ -260,6 +260,30 @@ def test_that_emphasis_beside_international_characters_detected
260260    assert_equal  %(<p><em>foobar ä</em></p>\n ) ,  rd . to_html 
261261  end 
262262
263+   def  test_taht 
264+     rd  =  RDiscount . new ( <<EOS ,  :explicitlist ) 
265+ - Bullet 
266+ - Bullet 
267+ 
268+ 1. Numbered 
269+ 2. Numbered 
270+ EOS 
271+ 
272+     assert_equal  <<EOS ,  rd . to_html 
273+ <ul> 
274+ <li>Bullet</li> 
275+ <li>Bullet</li> 
276+ </ul> 
277+ 
278+ 
279+ <ol> 
280+ <li>Numbered</li> 
281+ <li>Numbered</li> 
282+ </ol> 
283+ 
284+ EOS 
285+   end 
286+ 
263287  def  test_that_extra_definition_lists_work 
264288    rd  =  RDiscount . new ( <<EOS ) 
265289tag1 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments