Skip to content
This repository
Browse code

Convert special symbols (e.g., \alpha) to corresponding html or utf8 …

…for textile.

The replacement code is autogenerated from Emacs. The generated code is included because org-ruby should not require Emacs and org-mode for building. The generation is not added to Rake (yet) and you have to run it manually from Emacs.
  • Loading branch information...
commit 7354b5874f90862b6f76c0a7085d475b4940a0d6 1 parent d37889f
Rüdiger Sonderfeld ruediger authored
3  .gitignore
... ... @@ -1 +1,2 @@
1   -*.tmproj
  1 +*.tmproj
  2 +/util/gen-special-replace.elc
2  lib/org-ruby/html_output_buffer.rb
... ... @@ -1,3 +1,4 @@
  1 +require OrgRuby.libpath(*%w[org-ruby html_symbol_replace])
1 2 require OrgRuby.libpath(*%w[org-ruby output_buffer])
2 3
3 4 module Orgmode
@@ -223,6 +224,7 @@ def inline_formatting(str)
223 224 "<sup><a class=\"footref\" name=\"fnr.#{name}\" href=\"#fn.#{name}\">#{name}</a></sup>"
224 225 end
225 226 end
  227 + Orgmode.special_symbols_to_html(str)
226 228 str
227 229 end
228 230 end # class HtmlOutputBuffer
345 lib/org-ruby/html_symbol_replace.rb
... ... @@ -0,0 +1,345 @@
  1 +# Autogenerated by util/gen-special-replace.el
  2 +
  3 +module Orgmode
  4 + def Orgmode.special_symbols_to_html(str)
  5 + str.gsub!(/\\Agrave((\{\})|\s|$)/, "&Agrave;")
  6 + str.gsub!(/\\agrave((\{\})|\s|$)/, "&agrave;")
  7 + str.gsub!(/\\Aacute((\{\})|\s|$)/, "&Aacute;")
  8 + str.gsub!(/\\aacute((\{\})|\s|$)/, "&aacute;")
  9 + str.gsub!(/\\Acirc((\{\})|\s|$)/, "&Acirc;")
  10 + str.gsub!(/\\acirc((\{\})|\s|$)/, "&acirc;")
  11 + str.gsub!(/\\Atilde((\{\})|\s|$)/, "&Atilde;")
  12 + str.gsub!(/\\atilde((\{\})|\s|$)/, "&atilde;")
  13 + str.gsub!(/\\Auml((\{\})|\s|$)/, "&Auml;")
  14 + str.gsub!(/\\auml((\{\})|\s|$)/, "&auml;")
  15 + str.gsub!(/\\Aring((\{\})|\s|$)/, "&Aring;")
  16 + str.gsub!(/\\AA((\{\})|\s|$)/, "&Aring;")
  17 + str.gsub!(/\\aring((\{\})|\s|$)/, "&aring;")
  18 + str.gsub!(/\\AElig((\{\})|\s|$)/, "&AElig;")
  19 + str.gsub!(/\\aelig((\{\})|\s|$)/, "&aelig;")
  20 + str.gsub!(/\\Ccedil((\{\})|\s|$)/, "&Ccedil;")
  21 + str.gsub!(/\\ccedil((\{\})|\s|$)/, "&ccedil;")
  22 + str.gsub!(/\\Egrave((\{\})|\s|$)/, "&Egrave;")
  23 + str.gsub!(/\\egrave((\{\})|\s|$)/, "&egrave;")
  24 + str.gsub!(/\\Eacute((\{\})|\s|$)/, "&Eacute;")
  25 + str.gsub!(/\\eacute((\{\})|\s|$)/, "&eacute;")
  26 + str.gsub!(/\\Ecirc((\{\})|\s|$)/, "&Ecirc;")
  27 + str.gsub!(/\\ecirc((\{\})|\s|$)/, "&ecirc;")
  28 + str.gsub!(/\\Euml((\{\})|\s|$)/, "&Euml;")
  29 + str.gsub!(/\\euml((\{\})|\s|$)/, "&euml;")
  30 + str.gsub!(/\\Igrave((\{\})|\s|$)/, "&Igrave;")
  31 + str.gsub!(/\\igrave((\{\})|\s|$)/, "&igrave;")
  32 + str.gsub!(/\\Iacute((\{\})|\s|$)/, "&Iacute;")
  33 + str.gsub!(/\\iacute((\{\})|\s|$)/, "&iacute;")
  34 + str.gsub!(/\\Icirc((\{\})|\s|$)/, "&Icirc;")
  35 + str.gsub!(/\\icirc((\{\})|\s|$)/, "&icirc;")
  36 + str.gsub!(/\\Iuml((\{\})|\s|$)/, "&Iuml;")
  37 + str.gsub!(/\\iuml((\{\})|\s|$)/, "&iuml;")
  38 + str.gsub!(/\\Ntilde((\{\})|\s|$)/, "&Ntilde;")
  39 + str.gsub!(/\\ntilde((\{\})|\s|$)/, "&ntilde;")
  40 + str.gsub!(/\\Ograve((\{\})|\s|$)/, "&Ograve;")
  41 + str.gsub!(/\\ograve((\{\})|\s|$)/, "&ograve;")
  42 + str.gsub!(/\\Oacute((\{\})|\s|$)/, "&Oacute;")
  43 + str.gsub!(/\\oacute((\{\})|\s|$)/, "&oacute;")
  44 + str.gsub!(/\\Ocirc((\{\})|\s|$)/, "&Ocirc;")
  45 + str.gsub!(/\\ocirc((\{\})|\s|$)/, "&ocirc;")
  46 + str.gsub!(/\\Otilde((\{\})|\s|$)/, "&Otilde;")
  47 + str.gsub!(/\\otilde((\{\})|\s|$)/, "&otilde;")
  48 + str.gsub!(/\\Ouml((\{\})|\s|$)/, "&Ouml;")
  49 + str.gsub!(/\\ouml((\{\})|\s|$)/, "&ouml;")
  50 + str.gsub!(/\\Oslash((\{\})|\s|$)/, "&Oslash;")
  51 + str.gsub!(/\\oslash((\{\})|\s|$)/, "&oslash;")
  52 + str.gsub!(/\\OElig((\{\})|\s|$)/, "&OElig;")
  53 + str.gsub!(/\\oelig((\{\})|\s|$)/, "&oelig;")
  54 + str.gsub!(/\\Scaron((\{\})|\s|$)/, "&Scaron;")
  55 + str.gsub!(/\\scaron((\{\})|\s|$)/, "&scaron;")
  56 + str.gsub!(/\\szlig((\{\})|\s|$)/, "&szlig;")
  57 + str.gsub!(/\\Ugrave((\{\})|\s|$)/, "&Ugrave;")
  58 + str.gsub!(/\\ugrave((\{\})|\s|$)/, "&ugrave;")
  59 + str.gsub!(/\\Uacute((\{\})|\s|$)/, "&Uacute;")
  60 + str.gsub!(/\\uacute((\{\})|\s|$)/, "&uacute;")
  61 + str.gsub!(/\\Ucirc((\{\})|\s|$)/, "&Ucirc;")
  62 + str.gsub!(/\\ucirc((\{\})|\s|$)/, "&ucirc;")
  63 + str.gsub!(/\\Uuml((\{\})|\s|$)/, "&Uuml;")
  64 + str.gsub!(/\\uuml((\{\})|\s|$)/, "&uuml;")
  65 + str.gsub!(/\\Yacute((\{\})|\s|$)/, "&Yacute;")
  66 + str.gsub!(/\\yacute((\{\})|\s|$)/, "&yacute;")
  67 + str.gsub!(/\\Yuml((\{\})|\s|$)/, "&Yuml;")
  68 + str.gsub!(/\\yuml((\{\})|\s|$)/, "&yuml;")
  69 + str.gsub!(/\\fnof((\{\})|\s|$)/, "&fnof;")
  70 + str.gsub!(/\\real((\{\})|\s|$)/, "&real;")
  71 + str.gsub!(/\\image((\{\})|\s|$)/, "&image;")
  72 + str.gsub!(/\\weierp((\{\})|\s|$)/, "&weierp;")
  73 + str.gsub!(/\\Alpha((\{\})|\s|$)/, "&Alpha;")
  74 + str.gsub!(/\\alpha((\{\})|\s|$)/, "&alpha;")
  75 + str.gsub!(/\\Beta((\{\})|\s|$)/, "&Beta;")
  76 + str.gsub!(/\\beta((\{\})|\s|$)/, "&beta;")
  77 + str.gsub!(/\\Gamma((\{\})|\s|$)/, "&Gamma;")
  78 + str.gsub!(/\\gamma((\{\})|\s|$)/, "&gamma;")
  79 + str.gsub!(/\\Delta((\{\})|\s|$)/, "&Delta;")
  80 + str.gsub!(/\\delta((\{\})|\s|$)/, "&delta;")
  81 + str.gsub!(/\\Epsilon((\{\})|\s|$)/, "&Epsilon;")
  82 + str.gsub!(/\\epsilon((\{\})|\s|$)/, "&epsilon;")
  83 + str.gsub!(/\\varepsilon((\{\})|\s|$)/, "&epsilon;")
  84 + str.gsub!(/\\Zeta((\{\})|\s|$)/, "&Zeta;")
  85 + str.gsub!(/\\zeta((\{\})|\s|$)/, "&zeta;")
  86 + str.gsub!(/\\Eta((\{\})|\s|$)/, "&Eta;")
  87 + str.gsub!(/\\eta((\{\})|\s|$)/, "&eta;")
  88 + str.gsub!(/\\Theta((\{\})|\s|$)/, "&Theta;")
  89 + str.gsub!(/\\theta((\{\})|\s|$)/, "&theta;")
  90 + str.gsub!(/\\thetasym((\{\})|\s|$)/, "&thetasym;")
  91 + str.gsub!(/\\vartheta((\{\})|\s|$)/, "&thetasym;")
  92 + str.gsub!(/\\Iota((\{\})|\s|$)/, "&Iota;")
  93 + str.gsub!(/\\iota((\{\})|\s|$)/, "&iota;")
  94 + str.gsub!(/\\Kappa((\{\})|\s|$)/, "&Kappa;")
  95 + str.gsub!(/\\kappa((\{\})|\s|$)/, "&kappa;")
  96 + str.gsub!(/\\Lambda((\{\})|\s|$)/, "&Lambda;")
  97 + str.gsub!(/\\lambda((\{\})|\s|$)/, "&lambda;")
  98 + str.gsub!(/\\Mu((\{\})|\s|$)/, "&Mu;")
  99 + str.gsub!(/\\mu((\{\})|\s|$)/, "&mu;")
  100 + str.gsub!(/\\nu((\{\})|\s|$)/, "&nu;")
  101 + str.gsub!(/\\Nu((\{\})|\s|$)/, "&Nu;")
  102 + str.gsub!(/\\Xi((\{\})|\s|$)/, "&Xi;")
  103 + str.gsub!(/\\xi((\{\})|\s|$)/, "&xi;")
  104 + str.gsub!(/\\Omicron((\{\})|\s|$)/, "&Omicron;")
  105 + str.gsub!(/\\omicron((\{\})|\s|$)/, "&omicron;")
  106 + str.gsub!(/\\Pi((\{\})|\s|$)/, "&Pi;")
  107 + str.gsub!(/\\pi((\{\})|\s|$)/, "&pi;")
  108 + str.gsub!(/\\Rho((\{\})|\s|$)/, "&Rho;")
  109 + str.gsub!(/\\rho((\{\})|\s|$)/, "&rho;")
  110 + str.gsub!(/\\Sigma((\{\})|\s|$)/, "&Sigma;")
  111 + str.gsub!(/\\sigma((\{\})|\s|$)/, "&sigma;")
  112 + str.gsub!(/\\sigmaf((\{\})|\s|$)/, "&sigmaf;")
  113 + str.gsub!(/\\varsigma((\{\})|\s|$)/, "&sigmaf;")
  114 + str.gsub!(/\\Tau((\{\})|\s|$)/, "&Tau;")
  115 + str.gsub!(/\\Upsilon((\{\})|\s|$)/, "&Upsilon;")
  116 + str.gsub!(/\\upsih((\{\})|\s|$)/, "&upsih;")
  117 + str.gsub!(/\\upsilon((\{\})|\s|$)/, "&upsilon;")
  118 + str.gsub!(/\\Phi((\{\})|\s|$)/, "&Phi;")
  119 + str.gsub!(/\\phi((\{\})|\s|$)/, "&phi;")
  120 + str.gsub!(/\\Chi((\{\})|\s|$)/, "&Chi;")
  121 + str.gsub!(/\\chi((\{\})|\s|$)/, "&chi;")
  122 + str.gsub!(/\\acutex((\{\})|\s|$)/, "&acute;x")
  123 + str.gsub!(/\\Psi((\{\})|\s|$)/, "&Psi;")
  124 + str.gsub!(/\\psi((\{\})|\s|$)/, "&psi;")
  125 + str.gsub!(/\\tau((\{\})|\s|$)/, "&tau;")
  126 + str.gsub!(/\\Omega((\{\})|\s|$)/, "&Omega;")
  127 + str.gsub!(/\\omega((\{\})|\s|$)/, "&omega;")
  128 + str.gsub!(/\\piv((\{\})|\s|$)/, "&piv;")
  129 + str.gsub!(/\\partial((\{\})|\s|$)/, "&part;")
  130 + str.gsub!(/\\alefsym((\{\})|\s|$)/, "&alefsym;")
  131 + str.gsub!(/\\ETH((\{\})|\s|$)/, "&ETH;")
  132 + str.gsub!(/\\eth((\{\})|\s|$)/, "&eth;")
  133 + str.gsub!(/\\THORN((\{\})|\s|$)/, "&THORN;")
  134 + str.gsub!(/\\thorn((\{\})|\s|$)/, "&thorn;")
  135 + str.gsub!(/\\dots((\{\})|\s|$)/, "&hellip;")
  136 + str.gsub!(/\\hellip((\{\})|\s|$)/, "&hellip;")
  137 + str.gsub!(/\\middot((\{\})|\s|$)/, "&middot;")
  138 + str.gsub!(/\\iexcl((\{\})|\s|$)/, "&iexcl;")
  139 + str.gsub!(/\\iquest((\{\})|\s|$)/, "&iquest;")
  140 + str.gsub!(/\\shy((\{\})|\s|$)/, "&shy;")
  141 + str.gsub!(/\\ndash((\{\})|\s|$)/, "&ndash;")
  142 + str.gsub!(/\\mdash((\{\})|\s|$)/, "&mdash;")
  143 + str.gsub!(/\\quot((\{\})|\s|$)/, "&quot;")
  144 + str.gsub!(/\\acute((\{\})|\s|$)/, "&acute;")
  145 + str.gsub!(/\\ldquo((\{\})|\s|$)/, "&ldquo;")
  146 + str.gsub!(/\\rdquo((\{\})|\s|$)/, "&rdquo;")
  147 + str.gsub!(/\\bdquo((\{\})|\s|$)/, "&bdquo;")
  148 + str.gsub!(/\\lsquo((\{\})|\s|$)/, "&lsquo;")
  149 + str.gsub!(/\\rsquo((\{\})|\s|$)/, "&rsquo;")
  150 + str.gsub!(/\\sbquo((\{\})|\s|$)/, "&sbquo;")
  151 + str.gsub!(/\\laquo((\{\})|\s|$)/, "&laquo;")
  152 + str.gsub!(/\\raquo((\{\})|\s|$)/, "&raquo;")
  153 + str.gsub!(/\\lsaquo((\{\})|\s|$)/, "&lsaquo;")
  154 + str.gsub!(/\\rsaquo((\{\})|\s|$)/, "&rsaquo;")
  155 + str.gsub!(/\\circ((\{\})|\s|$)/, "&circ;")
  156 + str.gsub!(/\\vert((\{\})|\s|$)/, "&#124;")
  157 + str.gsub!(/\\brvbar((\{\})|\s|$)/, "&brvbar;")
  158 + str.gsub!(/\\sect((\{\})|\s|$)/, "&sect;")
  159 + str.gsub!(/\\amp((\{\})|\s|$)/, "&amp;")
  160 + str.gsub!(/\\lt((\{\})|\s|$)/, "&lt;")
  161 + str.gsub!(/\\gt((\{\})|\s|$)/, "&gt;")
  162 + str.gsub!(/\\tilde((\{\})|\s|$)/, "&tilde;")
  163 + str.gsub!(/\\dagger((\{\})|\s|$)/, "&dagger;")
  164 + str.gsub!(/\\Dagger((\{\})|\s|$)/, "&Dagger;")
  165 + str.gsub!(/\\nbsp((\{\})|\s|$)/, "&nbsp;")
  166 + str.gsub!(/\\ensp((\{\})|\s|$)/, "&ensp;")
  167 + str.gsub!(/\\emsp((\{\})|\s|$)/, "&emsp;")
  168 + str.gsub!(/\\thinsp((\{\})|\s|$)/, "&thinsp;")
  169 + str.gsub!(/\\curren((\{\})|\s|$)/, "&curren;")
  170 + str.gsub!(/\\cent((\{\})|\s|$)/, "&cent;")
  171 + str.gsub!(/\\pound((\{\})|\s|$)/, "&pound;")
  172 + str.gsub!(/\\yen((\{\})|\s|$)/, "&yen;")
  173 + str.gsub!(/\\euro((\{\})|\s|$)/, "&euro;")
  174 + str.gsub!(/\\EUR((\{\})|\s|$)/, "&euro;")
  175 + str.gsub!(/\\EURdig((\{\})|\s|$)/, "&euro;")
  176 + str.gsub!(/\\EURhv((\{\})|\s|$)/, "&euro;")
  177 + str.gsub!(/\\EURcr((\{\})|\s|$)/, "&euro;")
  178 + str.gsub!(/\\EURtm((\{\})|\s|$)/, "&euro;")
  179 + str.gsub!(/\\copy((\{\})|\s|$)/, "&copy;")
  180 + str.gsub!(/\\reg((\{\})|\s|$)/, "&reg;")
  181 + str.gsub!(/\\trade((\{\})|\s|$)/, "&trade;")
  182 + str.gsub!(/\\minus((\{\})|\s|$)/, "&minus;")
  183 + str.gsub!(/\\pm((\{\})|\s|$)/, "&plusmn;")
  184 + str.gsub!(/\\plusmn((\{\})|\s|$)/, "&plusmn;")
  185 + str.gsub!(/\\times((\{\})|\s|$)/, "&times;")
  186 + str.gsub!(/\\frasl((\{\})|\s|$)/, "&frasl;")
  187 + str.gsub!(/\\div((\{\})|\s|$)/, "&divide;")
  188 + str.gsub!(/\\frac12((\{\})|\s|$)/, "&frac12;")
  189 + str.gsub!(/\\frac14((\{\})|\s|$)/, "&frac14;")
  190 + str.gsub!(/\\frac34((\{\})|\s|$)/, "&frac34;")
  191 + str.gsub!(/\\permil((\{\})|\s|$)/, "&permil;")
  192 + str.gsub!(/\\sup1((\{\})|\s|$)/, "&sup1;")
  193 + str.gsub!(/\\sup2((\{\})|\s|$)/, "&sup2;")
  194 + str.gsub!(/\\sup3((\{\})|\s|$)/, "&sup3;")
  195 + str.gsub!(/\\radic((\{\})|\s|$)/, "&radic;")
  196 + str.gsub!(/\\sum((\{\})|\s|$)/, "&sum;")
  197 + str.gsub!(/\\prod((\{\})|\s|$)/, "&prod;")
  198 + str.gsub!(/\\micro((\{\})|\s|$)/, "&micro;")
  199 + str.gsub!(/\\macr((\{\})|\s|$)/, "&macr;")
  200 + str.gsub!(/\\deg((\{\})|\s|$)/, "&deg;")
  201 + str.gsub!(/\\prime((\{\})|\s|$)/, "&prime;")
  202 + str.gsub!(/\\Prime((\{\})|\s|$)/, "&Prime;")
  203 + str.gsub!(/\\infin((\{\})|\s|$)/, "&infin;")
  204 + str.gsub!(/\\infty((\{\})|\s|$)/, "&infin;")
  205 + str.gsub!(/\\prop((\{\})|\s|$)/, "&prop;")
  206 + str.gsub!(/\\proptp((\{\})|\s|$)/, "&prop;")
  207 + str.gsub!(/\\not((\{\})|\s|$)/, "&not;")
  208 + str.gsub!(/\\land((\{\})|\s|$)/, "&and;")
  209 + str.gsub!(/\\wedge((\{\})|\s|$)/, "&and;")
  210 + str.gsub!(/\\lor((\{\})|\s|$)/, "&or;")
  211 + str.gsub!(/\\vee((\{\})|\s|$)/, "&or;")
  212 + str.gsub!(/\\cap((\{\})|\s|$)/, "&cap;")
  213 + str.gsub!(/\\cup((\{\})|\s|$)/, "&cup;")
  214 + str.gsub!(/\\int((\{\})|\s|$)/, "&int;")
  215 + str.gsub!(/\\there4((\{\})|\s|$)/, "&there4;")
  216 + str.gsub!(/\\sim((\{\})|\s|$)/, "&sim;")
  217 + str.gsub!(/\\cong((\{\})|\s|$)/, "&cong;")
  218 + str.gsub!(/\\simeq((\{\})|\s|$)/, "&cong;")
  219 + str.gsub!(/\\asymp((\{\})|\s|$)/, "&asymp;")
  220 + str.gsub!(/\\approx((\{\})|\s|$)/, "&asymp;")
  221 + str.gsub!(/\\ne((\{\})|\s|$)/, "&ne;")
  222 + str.gsub!(/\\neq((\{\})|\s|$)/, "&ne;")
  223 + str.gsub!(/\\equiv((\{\})|\s|$)/, "&equiv;")
  224 + str.gsub!(/\\le((\{\})|\s|$)/, "&le;")
  225 + str.gsub!(/\\ge((\{\})|\s|$)/, "&ge;")
  226 + str.gsub!(/\\sub((\{\})|\s|$)/, "&sub;")
  227 + str.gsub!(/\\subset((\{\})|\s|$)/, "&sub;")
  228 + str.gsub!(/\\sup((\{\})|\s|$)/, "&sup;")
  229 + str.gsub!(/\\supset((\{\})|\s|$)/, "&sup;")
  230 + str.gsub!(/\\nsub((\{\})|\s|$)/, "&nsub;")
  231 + str.gsub!(/\\sube((\{\})|\s|$)/, "&sube;")
  232 + str.gsub!(/\\nsup((\{\})|\s|$)/, "&nsup;")
  233 + str.gsub!(/\\supe((\{\})|\s|$)/, "&supe;")
  234 + str.gsub!(/\\forall((\{\})|\s|$)/, "&forall;")
  235 + str.gsub!(/\\exist((\{\})|\s|$)/, "&exist;")
  236 + str.gsub!(/\\exists((\{\})|\s|$)/, "&exist;")
  237 + str.gsub!(/\\empty((\{\})|\s|$)/, "&empty;")
  238 + str.gsub!(/\\emptyset((\{\})|\s|$)/, "&empty;")
  239 + str.gsub!(/\\isin((\{\})|\s|$)/, "&isin;")
  240 + str.gsub!(/\\in((\{\})|\s|$)/, "&isin;")
  241 + str.gsub!(/\\notin((\{\})|\s|$)/, "&notin;")
  242 + str.gsub!(/\\ni((\{\})|\s|$)/, "&ni;")
  243 + str.gsub!(/\\nabla((\{\})|\s|$)/, "&nabla;")
  244 + str.gsub!(/\\ang((\{\})|\s|$)/, "&ang;")
  245 + str.gsub!(/\\angle((\{\})|\s|$)/, "&ang;")
  246 + str.gsub!(/\\perp((\{\})|\s|$)/, "&perp;")
  247 + str.gsub!(/\\sdot((\{\})|\s|$)/, "&sdot;")
  248 + str.gsub!(/\\cdot((\{\})|\s|$)/, "&sdot;")
  249 + str.gsub!(/\\lceil((\{\})|\s|$)/, "&lceil;")
  250 + str.gsub!(/\\rceil((\{\})|\s|$)/, "&rceil;")
  251 + str.gsub!(/\\lfloor((\{\})|\s|$)/, "&lfloor;")
  252 + str.gsub!(/\\rfloor((\{\})|\s|$)/, "&rfloor;")
  253 + str.gsub!(/\\lang((\{\})|\s|$)/, "&lang;")
  254 + str.gsub!(/\\rang((\{\})|\s|$)/, "&rang;")
  255 + str.gsub!(/\\larr((\{\})|\s|$)/, "&larr;")
  256 + str.gsub!(/\\leftarrow((\{\})|\s|$)/, "&larr;")
  257 + str.gsub!(/\\gets((\{\})|\s|$)/, "&larr;")
  258 + str.gsub!(/\\lArr((\{\})|\s|$)/, "&lArr;")
  259 + str.gsub!(/\\Leftarrow((\{\})|\s|$)/, "&lArr;")
  260 + str.gsub!(/\\uarr((\{\})|\s|$)/, "&uarr;")
  261 + str.gsub!(/\\uparrow((\{\})|\s|$)/, "&uarr;")
  262 + str.gsub!(/\\uArr((\{\})|\s|$)/, "&uArr;")
  263 + str.gsub!(/\\Uparrow((\{\})|\s|$)/, "&uArr;")
  264 + str.gsub!(/\\rarr((\{\})|\s|$)/, "&rarr;")
  265 + str.gsub!(/\\to((\{\})|\s|$)/, "&rarr;")
  266 + str.gsub!(/\\rightarrow((\{\})|\s|$)/, "&rarr;")
  267 + str.gsub!(/\\rArr((\{\})|\s|$)/, "&rArr;")
  268 + str.gsub!(/\\Rightarrow((\{\})|\s|$)/, "&rArr;")
  269 + str.gsub!(/\\darr((\{\})|\s|$)/, "&darr;")
  270 + str.gsub!(/\\downarrow((\{\})|\s|$)/, "&darr;")
  271 + str.gsub!(/\\dArr((\{\})|\s|$)/, "&dArr;")
  272 + str.gsub!(/\\Downarrow((\{\})|\s|$)/, "&dArr;")
  273 + str.gsub!(/\\harr((\{\})|\s|$)/, "&harr;")
  274 + str.gsub!(/\\leftrightarrow((\{\})|\s|$)/, "&harr;")
  275 + str.gsub!(/\\hArr((\{\})|\s|$)/, "&hArr;")
  276 + str.gsub!(/\\Leftrightarrow((\{\})|\s|$)/, "&hArr;")
  277 + str.gsub!(/\\crarr((\{\})|\s|$)/, "&crarr;")
  278 + str.gsub!(/\\hookleftarrow((\{\})|\s|$)/, "&crarr;")
  279 + str.gsub!(/\\arccos((\{\})|\s|$)/, "arccos")
  280 + str.gsub!(/\\arcsin((\{\})|\s|$)/, "arcsin")
  281 + str.gsub!(/\\arctan((\{\})|\s|$)/, "arctan")
  282 + str.gsub!(/\\arg((\{\})|\s|$)/, "arg")
  283 + str.gsub!(/\\cos((\{\})|\s|$)/, "cos")
  284 + str.gsub!(/\\cosh((\{\})|\s|$)/, "cosh")
  285 + str.gsub!(/\\cot((\{\})|\s|$)/, "cot")
  286 + str.gsub!(/\\coth((\{\})|\s|$)/, "coth")
  287 + str.gsub!(/\\csc((\{\})|\s|$)/, "csc")
  288 + str.gsub!(/\\deg((\{\})|\s|$)/, "&deg;")
  289 + str.gsub!(/\\det((\{\})|\s|$)/, "det")
  290 + str.gsub!(/\\dim((\{\})|\s|$)/, "dim")
  291 + str.gsub!(/\\exp((\{\})|\s|$)/, "exp")
  292 + str.gsub!(/\\gcd((\{\})|\s|$)/, "gcd")
  293 + str.gsub!(/\\hom((\{\})|\s|$)/, "hom")
  294 + str.gsub!(/\\inf((\{\})|\s|$)/, "inf")
  295 + str.gsub!(/\\ker((\{\})|\s|$)/, "ker")
  296 + str.gsub!(/\\lg((\{\})|\s|$)/, "lg")
  297 + str.gsub!(/\\lim((\{\})|\s|$)/, "lim")
  298 + str.gsub!(/\\liminf((\{\})|\s|$)/, "liminf")
  299 + str.gsub!(/\\limsup((\{\})|\s|$)/, "limsup")
  300 + str.gsub!(/\\ln((\{\})|\s|$)/, "ln")
  301 + str.gsub!(/\\log((\{\})|\s|$)/, "log")
  302 + str.gsub!(/\\max((\{\})|\s|$)/, "max")
  303 + str.gsub!(/\\min((\{\})|\s|$)/, "min")
  304 + str.gsub!(/\\Pr((\{\})|\s|$)/, "Pr")
  305 + str.gsub!(/\\sec((\{\})|\s|$)/, "sec")
  306 + str.gsub!(/\\sin((\{\})|\s|$)/, "sin")
  307 + str.gsub!(/\\sinh((\{\})|\s|$)/, "sinh")
  308 + str.gsub!(/\\sup((\{\})|\s|$)/, "&sup;")
  309 + str.gsub!(/\\tan((\{\})|\s|$)/, "tan")
  310 + str.gsub!(/\\tanh((\{\})|\s|$)/, "tanh")
  311 + str.gsub!(/\\bull((\{\})|\s|$)/, "&bull;")
  312 + str.gsub!(/\\bullet((\{\})|\s|$)/, "&bull;")
  313 + str.gsub!(/\\star((\{\})|\s|$)/, "*")
  314 + str.gsub!(/\\lowast((\{\})|\s|$)/, "&lowast;")
  315 + str.gsub!(/\\ast((\{\})|\s|$)/, "&lowast;")
  316 + str.gsub!(/\\odot((\{\})|\s|$)/, "o")
  317 + str.gsub!(/\\oplus((\{\})|\s|$)/, "&oplus;")
  318 + str.gsub!(/\\otimes((\{\})|\s|$)/, "&otimes;")
  319 + str.gsub!(/\\checkmark((\{\})|\s|$)/, "&#10003;")
  320 + str.gsub!(/\\para((\{\})|\s|$)/, "&para;")
  321 + str.gsub!(/\\ordf((\{\})|\s|$)/, "&ordf;")
  322 + str.gsub!(/\\ordm((\{\})|\s|$)/, "&ordm;")
  323 + str.gsub!(/\\cedil((\{\})|\s|$)/, "&cedil;")
  324 + str.gsub!(/\\oline((\{\})|\s|$)/, "&oline;")
  325 + str.gsub!(/\\uml((\{\})|\s|$)/, "&uml;")
  326 + str.gsub!(/\\zwnj((\{\})|\s|$)/, "&zwnj;")
  327 + str.gsub!(/\\zwj((\{\})|\s|$)/, "&zwj;")
  328 + str.gsub!(/\\lrm((\{\})|\s|$)/, "&lrm;")
  329 + str.gsub!(/\\rlm((\{\})|\s|$)/, "&rlm;")
  330 + str.gsub!(/\\smile((\{\})|\s|$)/, "&#9786;")
  331 + str.gsub!(/\\smiley((\{\})|\s|$)/, "&#9786;")
  332 + str.gsub!(/\\blacksmile((\{\})|\s|$)/, "&#9787;")
  333 + str.gsub!(/\\sad((\{\})|\s|$)/, "&#9785;")
  334 + str.gsub!(/\\clubs((\{\})|\s|$)/, "&clubs;")
  335 + str.gsub!(/\\clubsuit((\{\})|\s|$)/, "&clubs;")
  336 + str.gsub!(/\\spades((\{\})|\s|$)/, "&spades;")
  337 + str.gsub!(/\\spadesuit((\{\})|\s|$)/, "&spades;")
  338 + str.gsub!(/\\hearts((\{\})|\s|$)/, "&hearts;")
  339 + str.gsub!(/\\heartsuit((\{\})|\s|$)/, "&heartsuit;")
  340 + str.gsub!(/\\diams((\{\})|\s|$)/, "&diams;")
  341 + str.gsub!(/\\diamondsuit((\{\})|\s|$)/, "&diams;")
  342 + str.gsub!(/\\Diamond((\{\})|\s|$)/, "&diamond;")
  343 + str.gsub!(/\\loz((\{\})|\s|$)/, "&loz;")
  344 + end
  345 +end # module Orgmode
1  lib/org-ruby/textile_output_buffer.rb
@@ -58,6 +58,7 @@ def inline_formatting(input)
58 58 @footnotes[name] = defi if defi
59 59 "[#{name}]"
60 60 end
  61 + Orgmode.special_symbols_to_textile(input)
61 62 input
62 63 end
63 64
346 lib/org-ruby/textile_symbol_replace.rb
... ... @@ -0,0 +1,346 @@
  1 +# -*- coding: utf-8 -*-
  2 +# Autogenerated by util/gen-special-replace.el
  3 +
  4 +module Orgmode
  5 + def Orgmode.special_symbols_to_textile(str)
  6 + str.gsub!(/\\Agrave((\{\})|\s|$)/, "À")
  7 + str.gsub!(/\\agrave((\{\})|\s|$)/, "à")
  8 + str.gsub!(/\\Aacute((\{\})|\s|$)/, "Á")
  9 + str.gsub!(/\\aacute((\{\})|\s|$)/, "á")
  10 + str.gsub!(/\\Acirc((\{\})|\s|$)/, "Â")
  11 + str.gsub!(/\\acirc((\{\})|\s|$)/, "â")
  12 + str.gsub!(/\\Atilde((\{\})|\s|$)/, "Ã")
  13 + str.gsub!(/\\atilde((\{\})|\s|$)/, "ã")
  14 + str.gsub!(/\\Auml((\{\})|\s|$)/, "Ä")
  15 + str.gsub!(/\\auml((\{\})|\s|$)/, "ä")
  16 + str.gsub!(/\\Aring((\{\})|\s|$)/, "Å")
  17 + str.gsub!(/\\AA((\{\})|\s|$)/, "Å")
  18 + str.gsub!(/\\aring((\{\})|\s|$)/, "å")
  19 + str.gsub!(/\\AElig((\{\})|\s|$)/, "Æ")
  20 + str.gsub!(/\\aelig((\{\})|\s|$)/, "æ")
  21 + str.gsub!(/\\Ccedil((\{\})|\s|$)/, "Ç")
  22 + str.gsub!(/\\ccedil((\{\})|\s|$)/, "ç")
  23 + str.gsub!(/\\Egrave((\{\})|\s|$)/, "È")
  24 + str.gsub!(/\\egrave((\{\})|\s|$)/, "è")
  25 + str.gsub!(/\\Eacute((\{\})|\s|$)/, "É")
  26 + str.gsub!(/\\eacute((\{\})|\s|$)/, "é")
  27 + str.gsub!(/\\Ecirc((\{\})|\s|$)/, "Ê")
  28 + str.gsub!(/\\ecirc((\{\})|\s|$)/, "ê")
  29 + str.gsub!(/\\Euml((\{\})|\s|$)/, "Ë")
  30 + str.gsub!(/\\euml((\{\})|\s|$)/, "ë")
  31 + str.gsub!(/\\Igrave((\{\})|\s|$)/, "Ì")
  32 + str.gsub!(/\\igrave((\{\})|\s|$)/, "ì")
  33 + str.gsub!(/\\Iacute((\{\})|\s|$)/, "Í")
  34 + str.gsub!(/\\iacute((\{\})|\s|$)/, "í")
  35 + str.gsub!(/\\Icirc((\{\})|\s|$)/, "Î")
  36 + str.gsub!(/\\icirc((\{\})|\s|$)/, "î")
  37 + str.gsub!(/\\Iuml((\{\})|\s|$)/, "Ï")
  38 + str.gsub!(/\\iuml((\{\})|\s|$)/, "ï")
  39 + str.gsub!(/\\Ntilde((\{\})|\s|$)/, "Ñ")
  40 + str.gsub!(/\\ntilde((\{\})|\s|$)/, "ñ")
  41 + str.gsub!(/\\Ograve((\{\})|\s|$)/, "Ò")
  42 + str.gsub!(/\\ograve((\{\})|\s|$)/, "ò")
  43 + str.gsub!(/\\Oacute((\{\})|\s|$)/, "Ó")
  44 + str.gsub!(/\\oacute((\{\})|\s|$)/, "ó")
  45 + str.gsub!(/\\Ocirc((\{\})|\s|$)/, "Ô")
  46 + str.gsub!(/\\ocirc((\{\})|\s|$)/, "ô")
  47 + str.gsub!(/\\Otilde((\{\})|\s|$)/, "Õ")
  48 + str.gsub!(/\\otilde((\{\})|\s|$)/, "õ")
  49 + str.gsub!(/\\Ouml((\{\})|\s|$)/, "Ö")
  50 + str.gsub!(/\\ouml((\{\})|\s|$)/, "ö")
  51 + str.gsub!(/\\Oslash((\{\})|\s|$)/, "Ø")
  52 + str.gsub!(/\\oslash((\{\})|\s|$)/, "ø")
  53 + str.gsub!(/\\OElig((\{\})|\s|$)/, "Œ")
  54 + str.gsub!(/\\oelig((\{\})|\s|$)/, "œ")
  55 + str.gsub!(/\\Scaron((\{\})|\s|$)/, "Š")
  56 + str.gsub!(/\\scaron((\{\})|\s|$)/, "š")
  57 + str.gsub!(/\\szlig((\{\})|\s|$)/, "ß")
  58 + str.gsub!(/\\Ugrave((\{\})|\s|$)/, "Ù")
  59 + str.gsub!(/\\ugrave((\{\})|\s|$)/, "ù")
  60 + str.gsub!(/\\Uacute((\{\})|\s|$)/, "Ú")
  61 + str.gsub!(/\\uacute((\{\})|\s|$)/, "ú")
  62 + str.gsub!(/\\Ucirc((\{\})|\s|$)/, "Û")
  63 + str.gsub!(/\\ucirc((\{\})|\s|$)/, "û")
  64 + str.gsub!(/\\Uuml((\{\})|\s|$)/, "Ü")
  65 + str.gsub!(/\\uuml((\{\})|\s|$)/, "ü")
  66 + str.gsub!(/\\Yacute((\{\})|\s|$)/, "Ý")
  67 + str.gsub!(/\\yacute((\{\})|\s|$)/, "ý")
  68 + str.gsub!(/\\Yuml((\{\})|\s|$)/, "Ÿ")
  69 + str.gsub!(/\\yuml((\{\})|\s|$)/, "ÿ")
  70 + str.gsub!(/\\fnof((\{\})|\s|$)/, "ƒ")
  71 + str.gsub!(/\\real((\{\})|\s|$)/, "ℜ")
  72 + str.gsub!(/\\image((\{\})|\s|$)/, "ℑ")
  73 + str.gsub!(/\\weierp((\{\})|\s|$)/, "℘")
  74 + str.gsub!(/\\Alpha((\{\})|\s|$)/, "Α")
  75 + str.gsub!(/\\alpha((\{\})|\s|$)/, "α")
  76 + str.gsub!(/\\Beta((\{\})|\s|$)/, "Β")
  77 + str.gsub!(/\\beta((\{\})|\s|$)/, "β")
  78 + str.gsub!(/\\Gamma((\{\})|\s|$)/, "Γ")
  79 + str.gsub!(/\\gamma((\{\})|\s|$)/, "γ")
  80 + str.gsub!(/\\Delta((\{\})|\s|$)/, "Δ")
  81 + str.gsub!(/\\delta((\{\})|\s|$)/, "δ")
  82 + str.gsub!(/\\Epsilon((\{\})|\s|$)/, "Ε")
  83 + str.gsub!(/\\epsilon((\{\})|\s|$)/, "ε")
  84 + str.gsub!(/\\varepsilon((\{\})|\s|$)/, "ε")
  85 + str.gsub!(/\\Zeta((\{\})|\s|$)/, "Ζ")
  86 + str.gsub!(/\\zeta((\{\})|\s|$)/, "ζ")
  87 + str.gsub!(/\\Eta((\{\})|\s|$)/, "Η")
  88 + str.gsub!(/\\eta((\{\})|\s|$)/, "η")
  89 + str.gsub!(/\\Theta((\{\})|\s|$)/, "Θ")
  90 + str.gsub!(/\\theta((\{\})|\s|$)/, "θ")
  91 + str.gsub!(/\\thetasym((\{\})|\s|$)/, "ϑ")
  92 + str.gsub!(/\\vartheta((\{\})|\s|$)/, "ϑ")
  93 + str.gsub!(/\\Iota((\{\})|\s|$)/, "Ι")
  94 + str.gsub!(/\\iota((\{\})|\s|$)/, "ι")
  95 + str.gsub!(/\\Kappa((\{\})|\s|$)/, "Κ")
  96 + str.gsub!(/\\kappa((\{\})|\s|$)/, "κ")
  97 + str.gsub!(/\\Lambda((\{\})|\s|$)/, "Λ")
  98 + str.gsub!(/\\lambda((\{\})|\s|$)/, "λ")
  99 + str.gsub!(/\\Mu((\{\})|\s|$)/, "Μ")
  100 + str.gsub!(/\\mu((\{\})|\s|$)/, "μ")
  101 + str.gsub!(/\\nu((\{\})|\s|$)/, "ν")
  102 + str.gsub!(/\\Nu((\{\})|\s|$)/, "Ν")
  103 + str.gsub!(/\\Xi((\{\})|\s|$)/, "Ξ")
  104 + str.gsub!(/\\xi((\{\})|\s|$)/, "ξ")
  105 + str.gsub!(/\\Omicron((\{\})|\s|$)/, "Ο")
  106 + str.gsub!(/\\omicron((\{\})|\s|$)/, "ο")
  107 + str.gsub!(/\\Pi((\{\})|\s|$)/, "Π")
  108 + str.gsub!(/\\pi((\{\})|\s|$)/, "π")
  109 + str.gsub!(/\\Rho((\{\})|\s|$)/, "Ρ")
  110 + str.gsub!(/\\rho((\{\})|\s|$)/, "ρ")
  111 + str.gsub!(/\\Sigma((\{\})|\s|$)/, "Σ")
  112 + str.gsub!(/\\sigma((\{\})|\s|$)/, "σ")
  113 + str.gsub!(/\\sigmaf((\{\})|\s|$)/, "ς")
  114 + str.gsub!(/\\varsigma((\{\})|\s|$)/, "ς")
  115 + str.gsub!(/\\Tau((\{\})|\s|$)/, "Τ")
  116 + str.gsub!(/\\Upsilon((\{\})|\s|$)/, "Υ")
  117 + str.gsub!(/\\upsih((\{\})|\s|$)/, "ϒ")
  118 + str.gsub!(/\\upsilon((\{\})|\s|$)/, "υ")
  119 + str.gsub!(/\\Phi((\{\})|\s|$)/, "Φ")
  120 + str.gsub!(/\\phi((\{\})|\s|$)/, "φ")
  121 + str.gsub!(/\\Chi((\{\})|\s|$)/, "Χ")
  122 + str.gsub!(/\\chi((\{\})|\s|$)/, "χ")
  123 + str.gsub!(/\\acutex((\{\})|\s|$)/, "𝑥́")
  124 + str.gsub!(/\\Psi((\{\})|\s|$)/, "Ψ")
  125 + str.gsub!(/\\psi((\{\})|\s|$)/, "ψ")
  126 + str.gsub!(/\\tau((\{\})|\s|$)/, "τ")
  127 + str.gsub!(/\\Omega((\{\})|\s|$)/, "Ω")
  128 + str.gsub!(/\\omega((\{\})|\s|$)/, "ω")
  129 + str.gsub!(/\\piv((\{\})|\s|$)/, "ϖ")
  130 + str.gsub!(/\\partial((\{\})|\s|$)/, "∂")
  131 + str.gsub!(/\\alefsym((\{\})|\s|$)/, "ℵ")
  132 + str.gsub!(/\\ETH((\{\})|\s|$)/, "Ð")
  133 + str.gsub!(/\\eth((\{\})|\s|$)/, "ð")
  134 + str.gsub!(/\\THORN((\{\})|\s|$)/, "Þ")
  135 + str.gsub!(/\\thorn((\{\})|\s|$)/, "þ")
  136 + str.gsub!(/\\dots((\{\})|\s|$)/, "…")
  137 + str.gsub!(/\\hellip((\{\})|\s|$)/, "…")
  138 + str.gsub!(/\\middot((\{\})|\s|$)/, "·")
  139 + str.gsub!(/\\iexcl((\{\})|\s|$)/, "¡")
  140 + str.gsub!(/\\iquest((\{\})|\s|$)/, "¿")
  141 + str.gsub!(/\\shy((\{\})|\s|$)/, "")
  142 + str.gsub!(/\\ndash((\{\})|\s|$)/, "–")
  143 + str.gsub!(/\\mdash((\{\})|\s|$)/, "—")
  144 + str.gsub!(/\\quot((\{\})|\s|$)/, "\"")
  145 + str.gsub!(/\\acute((\{\})|\s|$)/, "´")
  146 + str.gsub!(/\\ldquo((\{\})|\s|$)/, "“")
  147 + str.gsub!(/\\rdquo((\{\})|\s|$)/, "”")
  148 + str.gsub!(/\\bdquo((\{\})|\s|$)/, "„")
  149 + str.gsub!(/\\lsquo((\{\})|\s|$)/, "‘")
  150 + str.gsub!(/\\rsquo((\{\})|\s|$)/, "’")
  151 + str.gsub!(/\\sbquo((\{\})|\s|$)/, "‚")
  152 + str.gsub!(/\\laquo((\{\})|\s|$)/, "«")
  153 + str.gsub!(/\\raquo((\{\})|\s|$)/, "»")
  154 + str.gsub!(/\\lsaquo((\{\})|\s|$)/, "‹")
  155 + str.gsub!(/\\rsaquo((\{\})|\s|$)/, "›")
  156 + str.gsub!(/\\circ((\{\})|\s|$)/, "ˆ")
  157 + str.gsub!(/\\vert((\{\})|\s|$)/, "|")
  158 + str.gsub!(/\\brvbar((\{\})|\s|$)/, "¦")
  159 + str.gsub!(/\\sect((\{\})|\s|$)/, "§")
  160 + str.gsub!(/\\amp((\{\})|\s|$)/, "&")
  161 + str.gsub!(/\\lt((\{\})|\s|$)/, "<")
  162 + str.gsub!(/\\gt((\{\})|\s|$)/, ">")
  163 + str.gsub!(/\\tilde((\{\})|\s|$)/, "~")
  164 + str.gsub!(/\\dagger((\{\})|\s|$)/, "†")
  165 + str.gsub!(/\\Dagger((\{\})|\s|$)/, "‡")
  166 + str.gsub!(/\\nbsp((\{\})|\s|$)/, " ")
  167 + str.gsub!(/\\ensp((\{\})|\s|$)/, " ")
  168 + str.gsub!(/\\emsp((\{\})|\s|$)/, " ")
  169 + str.gsub!(/\\thinsp((\{\})|\s|$)/, " ")
  170 + str.gsub!(/\\curren((\{\})|\s|$)/, "¤")
  171 + str.gsub!(/\\cent((\{\})|\s|$)/, "¢")
  172 + str.gsub!(/\\pound((\{\})|\s|$)/, "£")
  173 + str.gsub!(/\\yen((\{\})|\s|$)/, "¥")
  174 + str.gsub!(/\\euro((\{\})|\s|$)/, "€")
  175 + str.gsub!(/\\EUR((\{\})|\s|$)/, "€")
  176 + str.gsub!(/\\EURdig((\{\})|\s|$)/, "€")
  177 + str.gsub!(/\\EURhv((\{\})|\s|$)/, "€")
  178 + str.gsub!(/\\EURcr((\{\})|\s|$)/, "€")
  179 + str.gsub!(/\\EURtm((\{\})|\s|$)/, "€")
  180 + str.gsub!(/\\copy((\{\})|\s|$)/, "©")
  181 + str.gsub!(/\\reg((\{\})|\s|$)/, "®")
  182 + str.gsub!(/\\trade((\{\})|\s|$)/, "™")
  183 + str.gsub!(/\\minus((\{\})|\s|$)/, "−")
  184 + str.gsub!(/\\pm((\{\})|\s|$)/, "±")
  185 + str.gsub!(/\\plusmn((\{\})|\s|$)/, "±")
  186 + str.gsub!(/\\times((\{\})|\s|$)/, "×")
  187 + str.gsub!(/\\frasl((\{\})|\s|$)/, "⁄")
  188 + str.gsub!(/\\div((\{\})|\s|$)/, "÷")
  189 + str.gsub!(/\\frac12((\{\})|\s|$)/, "½")
  190 + str.gsub!(/\\frac14((\{\})|\s|$)/, "¼")
  191 + str.gsub!(/\\frac34((\{\})|\s|$)/, "¾")
  192 + str.gsub!(/\\permil((\{\})|\s|$)/, "‰")
  193 + str.gsub!(/\\sup1((\{\})|\s|$)/, "¹")
  194 + str.gsub!(/\\sup2((\{\})|\s|$)/, "²")
  195 + str.gsub!(/\\sup3((\{\})|\s|$)/, "³")
  196 + str.gsub!(/\\radic((\{\})|\s|$)/, "√")
  197 + str.gsub!(/\\sum((\{\})|\s|$)/, "∑")
  198 + str.gsub!(/\\prod((\{\})|\s|$)/, "∏")
  199 + str.gsub!(/\\micro((\{\})|\s|$)/, "µ")
  200 + str.gsub!(/\\macr((\{\})|\s|$)/, "¯")
  201 + str.gsub!(/\\deg((\{\})|\s|$)/, "°")
  202 + str.gsub!(/\\prime((\{\})|\s|$)/, "′")
  203 + str.gsub!(/\\Prime((\{\})|\s|$)/, "″")
  204 + str.gsub!(/\\infin((\{\})|\s|$)/, "∞")
  205 + str.gsub!(/\\infty((\{\})|\s|$)/, "∞")
  206 + str.gsub!(/\\prop((\{\})|\s|$)/, "∝")
  207 + str.gsub!(/\\proptp((\{\})|\s|$)/, "∝")
  208 + str.gsub!(/\\not((\{\})|\s|$)/, "¬")
  209 + str.gsub!(/\\land((\{\})|\s|$)/, "∧")
  210 + str.gsub!(/\\wedge((\{\})|\s|$)/, "∧")
  211 + str.gsub!(/\\lor((\{\})|\s|$)/, "∨")
  212 + str.gsub!(/\\vee((\{\})|\s|$)/, "∨")
  213 + str.gsub!(/\\cap((\{\})|\s|$)/, "∩")
  214 + str.gsub!(/\\cup((\{\})|\s|$)/, "∪")
  215 + str.gsub!(/\\int((\{\})|\s|$)/, "∫")
  216 + str.gsub!(/\\there4((\{\})|\s|$)/, "∴")
  217 + str.gsub!(/\\sim((\{\})|\s|$)/, "∼")
  218 + str.gsub!(/\\cong((\{\})|\s|$)/, "≅")
  219 + str.gsub!(/\\simeq((\{\})|\s|$)/, "≅")
  220 + str.gsub!(/\\asymp((\{\})|\s|$)/, "≈")
  221 + str.gsub!(/\\approx((\{\})|\s|$)/, "≈")
  222 + str.gsub!(/\\ne((\{\})|\s|$)/, "≠")
  223 + str.gsub!(/\\neq((\{\})|\s|$)/, "≠")
  224 + str.gsub!(/\\equiv((\{\})|\s|$)/, "≡")
  225 + str.gsub!(/\\le((\{\})|\s|$)/, "≤")
  226 + str.gsub!(/\\ge((\{\})|\s|$)/, "≥")
  227 + str.gsub!(/\\sub((\{\})|\s|$)/, "⊂")
  228 + str.gsub!(/\\subset((\{\})|\s|$)/, "⊂")
  229 + str.gsub!(/\\sup((\{\})|\s|$)/, "⊃")
  230 + str.gsub!(/\\supset((\{\})|\s|$)/, "⊃")
  231 + str.gsub!(/\\nsub((\{\})|\s|$)/, "⊄")
  232 + str.gsub!(/\\sube((\{\})|\s|$)/, "⊆")
  233 + str.gsub!(/\\nsup((\{\})|\s|$)/, "⊅")
  234 + str.gsub!(/\\supe((\{\})|\s|$)/, "⊇")
  235 + str.gsub!(/\\forall((\{\})|\s|$)/, "∀")
  236 + str.gsub!(/\\exist((\{\})|\s|$)/, "∃")
  237 + str.gsub!(/\\exists((\{\})|\s|$)/, "∃")
  238 + str.gsub!(/\\empty((\{\})|\s|$)/, "∅")
  239 + str.gsub!(/\\emptyset((\{\})|\s|$)/, "∅")
  240 + str.gsub!(/\\isin((\{\})|\s|$)/, "∈")
  241 + str.gsub!(/\\in((\{\})|\s|$)/, "∈")
  242 + str.gsub!(/\\notin((\{\})|\s|$)/, "∉")
  243 + str.gsub!(/\\ni((\{\})|\s|$)/, "∋")
  244 + str.gsub!(/\\nabla((\{\})|\s|$)/, "∇")
  245 + str.gsub!(/\\ang((\{\})|\s|$)/, "∠")
  246 + str.gsub!(/\\angle((\{\})|\s|$)/, "∠")
  247 + str.gsub!(/\\perp((\{\})|\s|$)/, "⊥")
  248 + str.gsub!(/\\sdot((\{\})|\s|$)/, "⋅")
  249 + str.gsub!(/\\cdot((\{\})|\s|$)/, "⋅")
  250 + str.gsub!(/\\lceil((\{\})|\s|$)/, "⌈")
  251 + str.gsub!(/\\rceil((\{\})|\s|$)/, "⌉")
  252 + str.gsub!(/\\lfloor((\{\})|\s|$)/, "⌊")
  253 + str.gsub!(/\\rfloor((\{\})|\s|$)/, "⌋")
  254 + str.gsub!(/\\lang((\{\})|\s|$)/, "⟨")
  255 + str.gsub!(/\\rang((\{\})|\s|$)/, "⟩")
  256 + str.gsub!(/\\larr((\{\})|\s|$)/, "←")
  257 + str.gsub!(/\\leftarrow((\{\})|\s|$)/, "←")
  258 + str.gsub!(/\\gets((\{\})|\s|$)/, "←")
  259 + str.gsub!(/\\lArr((\{\})|\s|$)/, "⇐")
  260 + str.gsub!(/\\Leftarrow((\{\})|\s|$)/, "⇐")
  261 + str.gsub!(/\\uarr((\{\})|\s|$)/, "↑")
  262 + str.gsub!(/\\uparrow((\{\})|\s|$)/, "↑")
  263 + str.gsub!(/\\uArr((\{\})|\s|$)/, "⇑")
  264 + str.gsub!(/\\Uparrow((\{\})|\s|$)/, "⇑")
  265 + str.gsub!(/\\rarr((\{\})|\s|$)/, "→")
  266 + str.gsub!(/\\to((\{\})|\s|$)/, "→")
  267 + str.gsub!(/\\rightarrow((\{\})|\s|$)/, "→")
  268 + str.gsub!(/\\rArr((\{\})|\s|$)/, "⇒")
  269 + str.gsub!(/\\Rightarrow((\{\})|\s|$)/, "⇒")
  270 + str.gsub!(/\\darr((\{\})|\s|$)/, "↓")
  271 + str.gsub!(/\\downarrow((\{\})|\s|$)/, "↓")
  272 + str.gsub!(/\\dArr((\{\})|\s|$)/, "⇓")
  273 + str.gsub!(/\\Downarrow((\{\})|\s|$)/, "⇓")
  274 + str.gsub!(/\\harr((\{\})|\s|$)/, "↔")
  275 + str.gsub!(/\\leftrightarrow((\{\})|\s|$)/, "↔")
  276 + str.gsub!(/\\hArr((\{\})|\s|$)/, "⇔")
  277 + str.gsub!(/\\Leftrightarrow((\{\})|\s|$)/, "⇔")
  278 + str.gsub!(/\\crarr((\{\})|\s|$)/, "↵")
  279 + str.gsub!(/\\hookleftarrow((\{\})|\s|$)/, "↵")
  280 + str.gsub!(/\\arccos((\{\})|\s|$)/, "arccos")
  281 + str.gsub!(/\\arcsin((\{\})|\s|$)/, "arcsin")
  282 + str.gsub!(/\\arctan((\{\})|\s|$)/, "arctan")
  283 + str.gsub!(/\\arg((\{\})|\s|$)/, "arg")
  284 + str.gsub!(/\\cos((\{\})|\s|$)/, "cos")
  285 + str.gsub!(/\\cosh((\{\})|\s|$)/, "cosh")
  286 + str.gsub!(/\\cot((\{\})|\s|$)/, "cot")
  287 + str.gsub!(/\\coth((\{\})|\s|$)/, "coth")
  288 + str.gsub!(/\\csc((\{\})|\s|$)/, "csc")
  289 + str.gsub!(/\\deg((\{\})|\s|$)/, "deg")
  290 + str.gsub!(/\\det((\{\})|\s|$)/, "det")
  291 + str.gsub!(/\\dim((\{\})|\s|$)/, "dim")
  292 + str.gsub!(/\\exp((\{\})|\s|$)/, "exp")
  293 + str.gsub!(/\\gcd((\{\})|\s|$)/, "gcd")
  294 + str.gsub!(/\\hom((\{\})|\s|$)/, "hom")
  295 + str.gsub!(/\\inf((\{\})|\s|$)/, "inf")
  296 + str.gsub!(/\\ker((\{\})|\s|$)/, "ker")
  297 + str.gsub!(/\\lg((\{\})|\s|$)/, "lg")
  298 + str.gsub!(/\\lim((\{\})|\s|$)/, "lim")
  299 + str.gsub!(/\\liminf((\{\})|\s|$)/, "liminf")
  300 + str.gsub!(/\\limsup((\{\})|\s|$)/, "limsup")
  301 + str.gsub!(/\\ln((\{\})|\s|$)/, "ln")
  302 + str.gsub!(/\\log((\{\})|\s|$)/, "log")
  303 + str.gsub!(/\\max((\{\})|\s|$)/, "max")
  304 + str.gsub!(/\\min((\{\})|\s|$)/, "min")
  305 + str.gsub!(/\\Pr((\{\})|\s|$)/, "Pr")
  306 + str.gsub!(/\\sec((\{\})|\s|$)/, "sec")
  307 + str.gsub!(/\\sin((\{\})|\s|$)/, "sin")
  308 + str.gsub!(/\\sinh((\{\})|\s|$)/, "sinh")
  309 + str.gsub!(/\\sup((\{\})|\s|$)/, "sup")
  310 + str.gsub!(/\\tan((\{\})|\s|$)/, "tan")
  311 + str.gsub!(/\\tanh((\{\})|\s|$)/, "tanh")
  312 + str.gsub!(/\\bull((\{\})|\s|$)/, "•")
  313 + str.gsub!(/\\bullet((\{\})|\s|$)/, "•")
  314 + str.gsub!(/\\star((\{\})|\s|$)/, "⋆")
  315 + str.gsub!(/\\lowast((\{\})|\s|$)/, "∗")
  316 + str.gsub!(/\\ast((\{\})|\s|$)/, "*")
  317 + str.gsub!(/\\odot((\{\})|\s|$)/, "ʘ")
  318 + str.gsub!(/\\oplus((\{\})|\s|$)/, "⊕")
  319 + str.gsub!(/\\otimes((\{\})|\s|$)/, "⊗")
  320 + str.gsub!(/\\checkmark((\{\})|\s|$)/, "✓")
  321 + str.gsub!(/\\para((\{\})|\s|$)/, "¶")
  322 + str.gsub!(/\\ordf((\{\})|\s|$)/, "ª")
  323 + str.gsub!(/\\ordm((\{\})|\s|$)/, "º")
  324 + str.gsub!(/\\cedil((\{\})|\s|$)/, "¸")
  325 + str.gsub!(/\\oline((\{\})|\s|$)/, "‾")
  326 + str.gsub!(/\\uml((\{\})|\s|$)/, "¨")
  327 + str.gsub!(/\\zwnj((\{\})|\s|$)/, "‌")
  328 + str.gsub!(/\\zwj((\{\})|\s|$)/, "‍")
  329 + str.gsub!(/\\lrm((\{\})|\s|$)/, "‎")
  330 + str.gsub!(/\\rlm((\{\})|\s|$)/, "‏")
  331 + str.gsub!(/\\smile((\{\})|\s|$)/, "⌣")
  332 + str.gsub!(/\\smiley((\{\})|\s|$)/, "☺")
  333 + str.gsub!(/\\blacksmile((\{\})|\s|$)/, "☻")
  334 + str.gsub!(/\\sad((\{\})|\s|$)/, "☹")
  335 + str.gsub!(/\\clubs((\{\})|\s|$)/, "♣")
  336 + str.gsub!(/\\clubsuit((\{\})|\s|$)/, "♣")
  337 + str.gsub!(/\\spades((\{\})|\s|$)/, "♠")
  338 + str.gsub!(/\\spadesuit((\{\})|\s|$)/, "♠")
  339 + str.gsub!(/\\hearts((\{\})|\s|$)/, "♥")
  340 + str.gsub!(/\\heartsuit((\{\})|\s|$)/, "♥")
  341 + str.gsub!(/\\diams((\{\})|\s|$)/, "♦")
  342 + str.gsub!(/\\diamondsuit((\{\})|\s|$)/, "♦")
  343 + str.gsub!(/\\Diamond((\{\})|\s|$)/, "⋄")
  344 + str.gsub!(/\\loz((\{\})|\s|$)/, "◊")
  345 + end
  346 +end # module Orgmode
37 util/gen-special-replace.el
... ... @@ -0,0 +1,37 @@
  1 +;; This code creates ruby code to replace special symbols with the corresponding utf8/html code
  2 +
  3 +(require 'org-entities)
  4 +
  5 +(defvar gen-use-entities-user t)
  6 +(defvar gen-file-name "replace-entities.rb")
  7 +
  8 +(defun generate-replace-inbuffer (what)
  9 + (let ((ll (if gen-use-entities-user
  10 + (append org-entities-user org-entities)
  11 + org-entities))
  12 + (to (if (string= what "html") 3
  13 + 6))) ; use utf8 for textile
  14 + (insert " def Orgmode.special_symbols_to_" what "(str)\n")
  15 + (dolist (entity ll)
  16 + (when (listp entity)
  17 + (let ((symb (nth to entity)))
  18 + (when (or (string= symb "\"") (string= symb "\\"))
  19 + (setq symb (concat "\\" symb)))
  20 + (insert " str.gsub!(/\\\\" (car entity) "((\\{\\})|\\s|$)/, \"" symb "\")\n"))))
  21 + (insert " end\n")))
  22 +
  23 +(defun generate-replace (file-name what)
  24 + (when (file-exists-p file-name)
  25 + (let ((buf (find-buffer-visiting file-name)))
  26 + (when buf
  27 + (kill-buffer buf)))
  28 + (delete-file file-name))
  29 + (find-file file-name)
  30 + (insert "# Autogenerated by util/gen-special-replace.el\n\nmodule Orgmode\n")
  31 + (generate-replace-inbuffer what)
  32 + (insert "end # module Orgmode\n")
  33 + (save-buffer)
  34 + (kill-buffer))
  35 +
  36 +(generate-replace "../lib/org-ruby/html_symbol_replace.rb" "html")
  37 +(generate-replace "../lib/org-ruby/textile_symbol_replace.rb" "textile")

0 comments on commit 7354b58

Please sign in to comment.
Something went wrong with that request. Please try again.