BigW Consortium Gitlab

Commit aac2af5b by Nick Thomas

HTMLEntityFilter -> HtmlEntityFilter

parent 516d869e
...@@ -3,7 +3,7 @@ require 'erb' ...@@ -3,7 +3,7 @@ require 'erb'
module Banzai module Banzai
module Filter module Filter
# Text filter that escapes these HTML entities: & " < > # Text filter that escapes these HTML entities: & " < >
class HTMLEntityFilter < HTML::Pipeline::TextFilter class HtmlEntityFilter < HTML::Pipeline::TextFilter
def call def call
ERB::Util.html_escape(text) ERB::Util.html_escape(text)
end end
......
...@@ -3,7 +3,7 @@ module Banzai ...@@ -3,7 +3,7 @@ module Banzai
class SingleLinePipeline < GfmPipeline class SingleLinePipeline < GfmPipeline
def self.filters def self.filters
@filters ||= FilterArray[ @filters ||= FilterArray[
Filter::HTMLEntityFilter, Filter::HtmlEntityFilter,
Filter::SanitizationFilter, Filter::SanitizationFilter,
Filter::EmojiFilter, Filter::EmojiFilter,
......
require 'spec_helper' require 'spec_helper'
describe Banzai::Filter::HTMLEntityFilter, lib: true do describe Banzai::Filter::HtmlEntityFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:unescaped) { 'foo <strike attr="foo">&&&</strike>' } let(:unescaped) { 'foo <strike attr="foo">&&&</strike>' }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment