File: redcloth_common.c.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-- 756 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(self, block, ts, te); }
  action esc_pre { rb_str_cat_escaped_for_preformatted(self, block, ts, te); }
  action ignore { rb_str_append(block, rb_funcall(self, rb_intern("ignore"), 1, regs)); }
  
  # conditionals
  action starts_line {
    p == orig_p || *(p-1) == '\r' || *(p-1) == '\n' || *(p-1) == '\f'
  }
  action starts_phrase {
    p == orig_p || *(p-1) == '\r' || *(p-1) == '\n' || *(p-1) == '\f' || *(p-1) == ' '
  }
  action extended { !NIL_P(extend) }
  action not_extended { NIL_P(extend) }
  action following_hash_is_ol_not_id { 
    (*(p+1) == '#') ? (*(p+2) == '#' || *(p+2) == '*' || *(p+2) == ' ') : 1 == 1
  }


  include redcloth_common "redcloth_common.rl";
  
}%%;