Class: Card::Content::Chunk::EscapedLiteral
- Defined in:
- mod/content/lib/card/content/chunk/escaped_literal.rb
Overview
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 and <pre> blocks
and within HTML tags.
Constant Summary collapse
- FULL_RE =
{ "[" => /\A\\\[\[[^\]]*\]\]/, "{" => /\A\\\{\{[^}]*\}\}/ }.freeze
Instance Attribute Summary
Attributes inherited from Abstract
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Abstract
#as_json, #burn_after_reading, #burn_read, #card, context_ok?, #format, full_match, #initialize, #inspect, #reference_code, #result, #to_s
Constructor Details
This class inherits a constructor from Card::Content::Chunk::Abstract
Class Method Details
Instance Method Details
#interpret(match, _content) ⇒ Object
21 22 23 |
# File 'mod/content/lib/card/content/chunk/escaped_literal.rb', line 21 def interpret match, _content @process_chunk = match[0].sub(/^\\(.)/, format.escape_literal('\1')) end |