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
|
module Uv
class RenderProcessor
def open_tag name, position
@stack << name
print escape(@line[@position...position].gsub(/\n|\r/, '')) if position > @position
@position = position
opt = options @stack
print "<span class='#{name_to_class(name)}'>" unless name=~/punctuation/
end
def name_to_class(name)
cl=""
tags=name.split(".")
(0..tags.length-1).each do |i|
cl << tags[0..i].join("_")
cl << " "
end
cl.strip
end
def close_tag name, position
print escape(@line[@position...position].gsub(/\n|\r/, '')) if position > @position
@position = position
opt = options @stack
print "</span>" unless name=~/punctuation/ @stack.pop
end
end
end
|