lib/html/pipeline/linuxfr.rb in html-pipeline-linuxfr-0.14.1 vs lib/html/pipeline/linuxfr.rb in html-pipeline-linuxfr-0.14.2
- old
+ new
@@ -13,11 +13,18 @@
pipeline = HTML::Pipeline.new [
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::TableOfContentsFilter,
HTML::Pipeline::SyntaxHighlightFilter,
HTML::Pipeline::RelativeLinksFilter,
- HTML::Pipeline::CustomLinksFilter
+ HTML::Pipeline::CustomLinksFilter,
+ HTML::Pipeline::SanitizationFilter
], CONTEXT
+ result = pipeline.call text
+ result[:output].to_s
+ end
+
+ def self.sanitize(text)
+ pipeline = HTML::Pipeline.new [HTML::Pipeline::SanitizationFilter], CONTEXT
result = pipeline.call text
result[:output].to_s
end
end