Module: Coradoc::Parser::Asciidoc::Inline
Instance Method Summary collapse
- #bold_constrained ⇒ Object
- #bold_unconstrained ⇒ Object
- #highlight_constrained ⇒ Object
- #highlight_unconstrained ⇒ Object
- #italic_constrained ⇒ Object
- #italic_unconstrained ⇒ Object
- #text_formatted ⇒ Object
- #text_unformatted ⇒ Object
Instance Method Details
#bold_constrained ⇒ Object
6 7 8 9 10 11 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 6 def bold_constrained (str('*') >> match("[^*]").repeat(1).as(:text).repeat(1,1) >> str('*') >> str('*').absent? ).as(:bold_constrained) end |
#bold_unconstrained ⇒ Object
13 14 15 16 17 18 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 13 def bold_unconstrained (str('**') >> match("[^*\n]").repeat(1).as(:text).repeat(1,1) >> str('**') ).as(:bold_unconstrained) end |
#highlight_constrained ⇒ Object
20 21 22 23 24 25 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 20 def highlight_constrained (str('#') >> match('[^#]').repeat(1).as(:text).repeat(1,1) >> str('#') >> str('#').absent? ).as(:highlight_constrained) end |
#highlight_unconstrained ⇒ Object
27 28 29 30 31 32 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 27 def highlight_unconstrained (str('##') >> match('[^#]').repeat(1).as(:text).repeat(1,1) >> str('##') ).as(:highlight_unconstrained) end |
#italic_constrained ⇒ Object
34 35 36 37 38 39 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 34 def italic_constrained (str('_') >> match('[^_]').repeat(1).as(:text).repeat(1,1) >> str('_') >> str('_').absent? ).as(:italic_constrained) end |
#italic_unconstrained ⇒ Object
41 42 43 44 45 46 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 41 def italic_unconstrained (str('__') >> match('[^_]').repeat(1).as(:text).repeat(1,1) >> str('__') ).as(:italic_unconstrained) end |
#text_formatted ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 61 def text_formatted ((cross_reference | bold_unconstrained | bold_constrained | highlight_unconstrained | highlight_constrained | italic_unconstrained | italic_constrained )| text_unformatted).repeat(1) end |
#text_unformatted ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/coradoc/parser/asciidoc/inline.rb', line 48 def text_unformatted (admonition_line.absent? >> (cross_reference.absent? | bold_unconstrained.absent? | bold_constrained.absent? | highlight_unconstrained.absent? | highlight_constrained.absent? | italic_unconstrained.absent? | italic_constrained.absent?) >> match('[^\n]').repeat(1) ) end |