]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
removes holder.js references from example docs 17467/head
authorCorbzilla <jason.ron.corbett@gmail.com>
Thu, 3 Sep 2015 18:54:01 +0000 (18:54 +0000)
committerCorbzilla <jason.ron.corbett@gmail.com>
Thu, 3 Sep 2015 18:54:01 +0000 (18:54 +0000)
docs/_plugins/highlight_alt.rb

index 5b877ee364cc8adaacf84221e20f4dfe3a4e1f9c..1fc9f5d2a89c5b467989e05e024532bdf3a66a06 100644 (file)
@@ -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