skatkov / rdoc-markdown

RDoc to Markdown generator
https://poshtui.com
GNU General Public License v3.0
24 stars 1 forks source link

Fix example code formatting #12

Closed skatkov closed 1 year ago

skatkov commented 2 years ago

Enumerable.md

Scroll to the bottom of a file, notice that code sections are not being formatted properly.

Examples:

    require'benchmark'a= (1..100000).map{rand(100000)                         
  }Benchmark.bm(10)do|b|b.report("Sort") {a.sort}b.report("Sort by")          
  {a.sort\_by{|a|a} }end  

This one seems to be completely missing all the new lines.

a=%w[xx xxx x xxxx]a.sort\_by{|s|s.size}# =\> ["x", "xx", "xxx",          
  "xxxx"]a.sort\_by{|s|-s.size}# =\> ["xxxx", "xxx", "xx", "x"]h=             
  {foo:2,bar:1,baz:0}h.sort\_by{|key,value|value}# =\> [[:baz, 0], [:bar, 1], 
  [:foo, 2]]h.sort\_by{|key,value|key}# =\> [[:bar, 1], [:baz, 0], [:foo, 2]]

This one has some weird extra characters (e.g. sort\_by)

I assume, that issue could be related to reverse_markdown gem that we're using.

skatkov commented 1 year ago

Issue was resolved #33