15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/vendor/serrano.rb', line 15
def apply(value)
if value.is_a? String
value = value.gsub(/(?:\$\\less|{\\&}lt\$\\mathsemicolon)\$\/?\w+(?:\$\\greater|{\\&}gt\$\\mathsemicolon)\$/,
'$\less$i$\greater$' => ' <i>', '$\less$/i$\greater$' => '</i> ',
'{\&}lt$\mathsemicolon$i{\&}gt$\mathsemicolon$' => ' <i>', '{\&}lt$\mathsemicolon$/i{\&}gt$\mathsemicolon$' => '</i> ',
'$\less$em$\greater$' => ' <i>', '$\less$/em$\greater$' => '</i> ',
'{\&}lt$\mathsemicolon$em{\&}gt$\mathsemicolon$' => ' <i>', '{\&}lt$\mathsemicolon$/em{\&}gt$\mathsemicolon$' => '</i> ',
).gsub(' ', ' ').gsub('> .', '>.').gsub('> ,', '>,')
end
::LaTeX.decode(value)
end
|