Sha256: 03610bf7bdaa5db93e910beafccb132c97ea3daf8c263d62c85c906c556a4c98
Contents?: true
Size: 675 Bytes
Versions: 11
Compression:
Stored size: 675 Bytes
Contents
module RevealCK module Markdown # This class knows how to modify emoji so that underscores within # emoji are not considered as indicators of markdown emphasis. class PreProcessorForEmoji attr_reader :doc def initialize(doc) @doc = doc end def process protect_emojis end private def protect_emojis doc.gsub!(emoji_regex) do |emoji| emoji.gsub(/_/, emoji_underscore_symbol) end end def emoji_regex /:[a-z\d_\-\+]*:/ end def emoji_underscore_symbol RevealCK::Markdown::REVEALCK_SYMBOL_FOR_EMOJI_UNDERSCORE end end end end
Version data entries
11 entries across 11 versions & 1 rubygems