mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-02 14:24:19 +01:00
removes holder.js references from example docs
This commit is contained in:
parent
1a6aad4548
commit
1f31077122
@ -58,10 +58,15 @@ eos
|
|||||||
"<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
|
||||||
|
Loading…
Reference in New Issue
Block a user