fork download
  1. puts readlines.map {|s| s.gsub(/^\* +|[\r\n ]+$/, '')}.chunk(&:empty?).select {|(b, _)| !b}.map {|(_, a)| "<ul>#{a.map {|s| "<li>#{s}</li>"}.join}</ul>"}
Success #stdin #stdout 0s 28224KB
stdin
* aaa 
* bbb 
* ccc 

* aaa 
* bbb 
* ccc 

* a
* b c
* d    
*   e
stdout
<ul><li>aaa</li><li>bbb</li><li>ccc</li></ul>
<ul><li>aaa</li><li>bbb</li><li>ccc</li></ul>
<ul><li>a</li><li>b c</li><li>d</li><li>e</li></ul>