File: redcloth_attributes.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 (30 lines) | stat: -rw-r--r-- 624 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
26
27
28
29
30
/*
 * redcloth_attributes.rl
 *
 * Copyright (C) 2009 Jason Garber
 */
%%{

  machine redcloth_attributes;
  
  C2 = ( C_CLASS_ID | C_STYL | C_LNGE )+ ;

  mtext_with_attributes = ( C2 mtext >A %T ) >X ;

  inline := |*

    mtext_with_attributes { SET_ATTRIBUTES(); } ;

  *|;

  link_text_with_attributes = C2 "."* " "* ( mtext+ ) >A %{ STORE("name"); } ;
  link_text_without_attributes = ( mtext+ ) >B %{ STORE_B("name_without_attributes"); } ;

  link_says := |*

    link_text_with_attributes { SET_ATTRIBUTES(); } ;
    link_text_without_attributes { SET_ATTRIBUTE("name_without_attributes", "name"); } ;

  *|;

}%%;