blog/_plugins/re_substitute.rb
Samuel FORESTIER a4f115b287 Makes Atom feed honor specifications (see below)
+ Fixes `type` of `content` and `summary` entries
- Removes `script` and `iframe` tags from entries content (from JSON feed too)

There is actually an issue with Jekyll when using `capture` and incremental build.
It was actually not related to `highlighter` config entry, so `f17a8ff3` has been partly reverted.
An issue has been opened upstream ([jekyll/jekyll#8062]).
From now, incremental build will be disabled.
2020-03-19 16:26:46 +01:00

13 lines
291 B
Ruby

# From <https://stackoverflow.com/a/25802375>.
module Jekyll
module RegexFilter
def re_substitute(input, reg_str, repl_str)
regexp = Regexp.new reg_str, Regexp::MULTILINE
input.gsub regexp, repl_str
end
end
end
Liquid::Template.register_filter(Jekyll::RegexFilter)