/
redcloth_attributes.rb.rl
56 lines (43 loc) · 1.05 KB
/
redcloth_attributes.rb.rl
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# redcloth_attributes.rb.rl
#
# Copyright (C) 2009 Jason Garber
#
%%{
machine redcloth_attributes;
include redcloth_common "redcloth_common.rb.rl";
include redcloth_attributes "redcloth_attributes.rl";
}%%
module RedCloth
class RedclothAttributes < BaseScanner
class << self
def redcloth_attribute_parser(machine, data)
@data = data
@regs = {}
@p = 0
@pe = @data.length
%% write init; #%
cs = machine
%% write exec; #%
return @regs
end
def redcloth_attributes(str)
self.cs = self.redcloth_attributes_en_inline
return redcloth_attribute_parser(cs, str)
end
def redcloth_link_attributes(str)
self.cs = self.redcloth_attributes_en_link_says;
return redcloth_attribute_parser(cs, str)
end
end
%%{
variable data @data;
variable p @p;
variable pe @pe;
variable cs @cs;
variable ts @ts;
variable te @te;
write data nofinal;
}%%
end
end