Sha256: ede37e207b055a63eb60b88815473c2bf91830bf61b39439f71acf15b7a3cc25
Contents?: true
Size: 541 Bytes
Versions: 1
Compression:
Stored size: 541 Bytes
Contents
module Filters module PreFilter def format_command_line(text) text.gsub /\n?``` command-line(.+?)```/m do |block| block.gsub! /^``` command-line/, '<pre class="command-line">' block.gsub! /^```$/, "</pre>\n" block.gsub!(/^\$ (.+)$/) { %Q|<span class="command">#{$1.rstrip}</span>| } block.gsub!(/^(\# .+)$/) { %Q|<span class="comment">#{$1.rstrip}</span>| } block.gsub!(/^> (.+)$/) { %Q|<span class="output"><span># </span>#{$1.rstrip}</span>| } block end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
extended-markdown-filter-0.4.2 | lib/filters/pre/command-line.rb |