Commit 1f310771 authored by Corbzilla's avatar Corbzilla
Browse files

removes holder.js references from example docs

parent 1a6aad45
Showing with 5 additions and 0 deletions
+5 -0
...@@ -57,11 +57,16 @@ eos ...@@ -57,11 +57,16 @@ eos
def example(output) def example(output)
"<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>" "<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>"
end end
def remove_holderjs(code)
code = code.gsub(/"holder.js.+?"/, '"..."')
end
def render_rouge(code) def render_rouge(code)
require 'rouge' require 'rouge'
formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false) formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false)
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
code = remove_holderjs(code)
code = formatter.format(lexer.lex(code)) code = formatter.format(lexer.lex(code))
"<div class=\"highlight\"><pre>#{code}</pre></div>" "<div class=\"highlight\"><pre>#{code}</pre></div>"
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment