lib/review/latexutils.rb in review-0.9.0 vs lib/review/latexutils.rb in review-1.0.0

- old
+ new

@@ -1,5 +1,6 @@ +# encoding: utf-8 # # $Id: latexutils.rb 2204 2006-03-18 06:10:26Z aamine $ # # Copyright (c) 2002-2006 Minero Aoki # @@ -24,11 +25,23 @@ '^' => '\textasciicircum{}', '~' => '\textasciitilde{}', '|' => '\textbar{}', '<' => '\textless{}', '>' => '\textgreater{}', - "\\" => '\reviewbackslash{}' + "\\" => '\reviewbackslash{}', + + '⓪' => '\UTF{24EA}', + '①' => '\UTF{2460}', + '②' => '\UTF{2461}', + '③' => '\UTF{2462}', + '④' => '\UTF{2463}', + '⑤' => '\UTF{2464}', + '⑥' => '\UTF{2465}', + '⑦' => '\UTF{2466}', + '⑧' => '\UTF{2467}', + '⑨' => '\UTF{2468}', + '⑩' => '\UTF{2469}', } METACHARS_RE = /[#{Regexp.escape(MATACHARS.keys.join(''))}]/ MATACHARS_INVERT = MATACHARS.invert @@ -48,9 +61,13 @@ } end def escape_index(str) str.gsub(/[@!|"]/) {|s| '"' + s } + end + + def escape_url(str) + str.gsub(/[\#%]/) {|s| '\\'+s } end def macro(name, *args) "\\#{name}" + args.map {|a| "{#{a}}" }.join('') end