File: redcloth_common.rb.rl

package info (click to toggle)
ruby-redcloth 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 708 kB
  • sloc: ruby: 1,233; ansic: 201; makefile: 25
file content (25 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%%{
  
  machine redcloth_common;
  
  action esc { rb_str_cat_escaped(@block, @ts, @te); }
  action esc_pre { rb_str_cat_escaped_for_preformatted(@block, STR_NEW(@ts, @te-@ts)); }
  action ignore { @block << @textile_doc.ignore(@regs); }
  
  # conditionals
  action starts_line {
    @p == 0 || @data[(@p-1), 1] == "\r" || @data[(@p-1), 1] == "\n" || @data[(@p-1), 1] == "\f"
  }
  action starts_phrase {
    @p == 0 || @data[(@p-1), 1] == "\r" || @data[(@p-1), 1] == "\n" || @data[(@p-1), 1] == "\f" || @data[(@p-1), 1] == " "
  }
  action extended { !@extend.nil? }
  action not_extended { @extend.nil? }
  action following_hash_is_ol_not_id { 
    @data[(@p+1), 1] == "#" ? (@data[(@p+2), 1] == "#" || @data[(@p+2), 1] == "*" || @data[(@p+2), 1] == " ") : true
  }
  
  
  include redcloth_common "redcloth_common.rl";
  
}%%;