Sha256: b696ca2be0224ca2605770c8fe0673a49a2cc36f3f6b85df0bab7c7cb2e94f0a
Contents?: true
Size: 671 Bytes
Versions: 14
Compression:
Stored size: 671 Bytes
Contents
# -*- encoding : utf-8 -*- # These are basic chunks that have a pattern and can be protected. # They are used by rendering process to prevent wiki rendering # occuring within literal areas such as <code> and <pre> blocks # and within HTML tags. module Card::Chunk class EscapedLiteral < Abstract FULL_RE = { '[' => /^\\\[\[[^\]]*\]\]/, '{' => /^\\\{\{[^\}]*\}\}/ } Card::Chunk.register_class self, { prefix_re: '\\\\(?:\\[\\[|\\{\\{)', idx_char: '\\' } def self.full_re prefix re = FULL_RE[ prefix[1,1] ] end def interpret match, content @process_chunk = match[0].sub(/^\\(.)/, "<span>\\1</span>") end end end
Version data entries
14 entries across 14 versions & 1 rubygems