Module: FromToUntilFilter

Defined in:
lib/jekyll_from_to_until.rb

Overview

Instance Method Summary collapse

Instance Method Details

#extra_decode(line) ⇒ Object

HTMLEntities does not support enough HTML entities



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/jekyll_from_to_until.rb', line 121

def extra_decode(line)
  line.gsub('{', '{')
      .gsub('}', '}')
      .gsub('(', '(')
      .gsub(')', ')')
      .gsub('&lparen;', '(')
      .gsub('&rparen;', ')')
      .gsub('[', '[')
      .gsub(']', ']')
      .gsub('[', '[')
      .gsub(']', ']')
end

#from(input_strings, regex) ⇒ Object



102
103
104
105
106
# File 'lib/jekyll_from_to_until.rb', line 102

def from(input_strings, regex)
  input_strings = extra_decode HTMLEntities.new.decode input_strings
  regex         = extra_decode HTMLEntities.new.decode regex
  FromToUntil.from(input_strings, regex) # method forwarding
end

#to(input_strings, regex) ⇒ Object



108
109
110
111
112
# File 'lib/jekyll_from_to_until.rb', line 108

def to(input_strings, regex)
  input_strings = extra_decode HTMLEntities.new.decode input_strings
  regex         = extra_decode HTMLEntities.new.decode regex
  FromToUntil.to(input_strings, regex) # method forwarding
end

#until(input_strings, regex) ⇒ Object



114
115
116
117
118
# File 'lib/jekyll_from_to_until.rb', line 114

def until(input_strings, regex)
  input_strings = extra_decode HTMLEntities.new.decode input_strings
  regex         = extra_decode HTMLEntities.new.decode regex
  FromToUntil.until(input_strings, regex) # method forwarding
end