lib/html/pipeline/linuxfr.rb in html-pipeline-linuxfr-0.15.6 vs lib/html/pipeline/linuxfr.rb in html-pipeline-linuxfr-0.15.7
- old
+ new
@@ -1,28 +1,28 @@
-# encoding: utf-8
module HTML
class Pipeline
class LinuxFr
CONTEXT = {
toc_minimal_length: 5000,
toc_header: "<h2 class=\"sommaire\">Sommaire</h2>\n",
svgtex_url: "http://localhost:16000",
host: "linuxfr.org"
- }
+ }.freeze
- def self.render(text)
+ def self.render(text, context = {})
pipeline = HTML::Pipeline.new [
HTML::Pipeline::SVGTeX::PreFilter,
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::SanitizationFilter,
HTML::Pipeline::TableOfContentsFilter,
HTML::Pipeline::SVGTeX::PostFilter,
HTML::Pipeline::SyntaxHighlightFilter,
+ HTML::Pipeline::NoFollowLinksFilter,
HTML::Pipeline::RelativeLinksFilter,
HTML::Pipeline::CustomLinksFilter,
], CONTEXT
- result = pipeline.call text
+ result = pipeline.call text, context
result[:output].to_s
end
def self.sanitize(html)
return "" if html.nil?