Sha256: 18584dec385749876abf69035c44d1247efa227484c340c4c88b3948faab1bc0
Contents?: true
Size: 542 Bytes
Versions: 5
Compression:
Stored size: 542 Bytes
Contents
module Filters module PreFilter def format_command_line(text) text.gsub /^\n?\s*``` command-line(.+?)```/m do |block| block.gsub! /^\s*``` command-line/, '<pre class="command-line">' block.gsub! /^\s*```$/, "</pre>\n" block.gsub!(/^\s*\$ (.+)$/) { %(<span class="command">#{$1.rstrip}</span>) } block.gsub!(/^\s*(\# .+)$/) { %(<span class="comment">#{$1.rstrip}</span>) } block.gsub!(/^\s*> (.+)$/) { %(<span class="output">#{$1.rstrip}</span>) } block end end end end
Version data entries
5 entries across 5 versions & 1 rubygems