Module: Coradoc::Parser::Asciidoc::Inline

Included in:
Base, Base
Defined in:
lib/coradoc/parser/asciidoc/inline.rb

Instance Method Summary collapse

Instance Method Details

#bold_constrainedObject



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_unconstrainedObject



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_constrainedObject



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_unconstrainedObject



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_constrainedObject



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_unconstrainedObject



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_formattedObject



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_unformattedObject



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