mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Merge pull request #17467 from Corbzilla/v4-dev-remove-holderjs-docs
V4 remove holderjs references from carousel and card docs
This commit is contained in:
commit
114a2d913e
1 changed files with 5 additions and 0 deletions
|
@ -57,11 +57,16 @@ eos
|
|||
def example(output)
|
||||
"<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>"
|
||||
end
|
||||
|
||||
def remove_holderjs(code)
|
||||
code = code.gsub(/"holder.js.+?"/, '"..."')
|
||||
end
|
||||
|
||||
def render_rouge(code)
|
||||
require 'rouge'
|
||||
formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false)
|
||||
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
|
||||
code = remove_holderjs(code)
|
||||
code = formatter.format(lexer.lex(code))
|
||||
"<div class=\"highlight\"><pre>#{code}</pre></div>"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue