Sha256: 399742b98626ac0e418cce783dc2eab659de070c96c4e6a7aa7d00f2fb2a5b80
Contents?: true
Size: 881 Bytes
Versions: 24
Compression:
Stored size: 881 Bytes
Contents
# -*- encoding : utf-8 -*- class Card class Content module Chunk # 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. class EscapedLiteral < Abstract FULL_RE = { "[" => /\A\\\[\[[^\]]*\]\]/, "{" => /\A\\\{\{[^}]*\}\}/ }.freeze Card::Content::Chunk.register_class self, prefix_re: '\\\\(?:\\[\\[|\\{\\{)', idx_char: "\\" def self.full_re prefix FULL_RE[prefix[1, 1]] end def interpret match, _content @process_chunk = match[0].sub(/^\\(.)/, format.escape_literal('\1')) end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems