Class: Kramdown::Parser::RFC2629Kramdown
- Defined in:
- lib/kramdown-rfc2629.rb
Constant Summary collapse
- XREF_START =
/\{\{(.*?)\}\}/u
Instance Method Summary collapse
-
#initialize(*doc) ⇒ RFC2629Kramdown
constructor
A new instance of RFC2629Kramdown.
-
#parse_xref ⇒ Object
Introduce new {target} syntax for empty xrefs, which would otherwise be an ugly  or  (I’d rather use [[target]], but that somehow clashes with links.).
Constructor Details
#initialize(*doc) ⇒ RFC2629Kramdown
Returns a new instance of RFC2629Kramdown.
32 33 34 35 |
# File 'lib/kramdown-rfc2629.rb', line 32 def initialize(*doc) super @span_parsers.unshift(:xref) end |
Instance Method Details
#parse_xref ⇒ Object
Introduce new {target} syntax for empty xrefs, which would otherwise be an ugly  or  (I’d rather use [[target]], but that somehow clashes with links.)
42 43 44 45 46 47 |
# File 'lib/kramdown-rfc2629.rb', line 42 def parse_xref @src.pos += @src.matched_size href = @src[1] el = Element.new(:xref, nil, {'target' => href}) @tree.children << el end |