Permalink
Browse files

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...
1 parent d37889f commit 7354b5874f90862b6f76c0a7085d475b4940a0d6 @ruediger ruediger committed Jul 23, 2011
View
3 .gitignore
@@ -1 +1,2 @@
-*.tmproj
+*.tmproj
+/util/gen-special-replace.elc
View
2 lib/org-ruby/html_output_buffer.rb
@@ -1,3 +1,4 @@
+require OrgRuby.libpath(*%w[org-ruby html_symbol_replace])
require OrgRuby.libpath(*%w[org-ruby output_buffer])
module Orgmode
@@ -223,6 +224,7 @@ def inline_formatting(str)
"<sup><a class=\"footref\" name=\"fnr.#{name}\" href=\"#fn.#{name}\">#{name}</a></sup>"
end
end
+ Orgmode.special_symbols_to_html(str)
str
end
end # class HtmlOutputBuffer
View
345 lib/org-ruby/html_symbol_replace.rb
@@ -0,0 +1,345 @@
+# Autogenerated by util/gen-special-replace.el
+
+module Orgmode
+ def Orgmode.special_symbols_to_html(str)
+ str.gsub!(/\\Agrave((\{\})|\s|$)/, "&Agrave;")
+ str.gsub!(/\\agrave((\{\})|\s|$)/, "&agrave;")
+ str.gsub!(/\\Aacute((\{\})|\s|$)/, "&Aacute;")
+ str.gsub!(/\\aacute((\{\})|\s|$)/, "&aacute;")
+ str.gsub!(/\\Acirc((\{\})|\s|$)/, "&Acirc;")
+ str.gsub!(/\\acirc((\{\})|\s|$)/, "&acirc;")
+ str.gsub!(/\\Atilde((\{\})|\s|$)/, "&Atilde;")
+ str.gsub!(/\\atilde((\{\})|\s|$)/, "&atilde;")
+ str.gsub!(/\\Auml((\{\})|\s|$)/, "&Auml;")
+ str.gsub!(/\\auml((\{\})|\s|$)/, "&auml;")
+ str.gsub!(/\\Aring((\{\})|\s|$)/, "&Aring;")
+ str.gsub!(/\\AA((\{\})|\s|$)/, "&Aring;")
+ str.gsub!(/\\aring((\{\})|\s|$)/, "&aring;")
+ str.gsub!(/\\AElig((\{\})|\s|$)/, "&AElig;")
+ str.gsub!(/\\aelig((\{\})|\s|$)/, "&aelig;")
+ str.gsub!(/\\Ccedil((\{\})|\s|$)/, "&Ccedil;")
+ str.gsub!(/\\ccedil((\{\})|\s|$)/, "&ccedil;")
+ str.gsub!(/\\Egrave((\{\})|\s|$)/, "&Egrave;")
+ str.gsub!(/\\egrave((\{\})|\s|$)/, "&egrave;")
+ str.gsub!(/\\Eacute((\{\})|\s|$)/, "&Eacute;")
+ str.gsub!(/\\eacute((\{\})|\s|$)/, "&eacute;")
+ str.gsub!(/\\Ecirc((\{\})|\s|$)/, "&Ecirc;")
+ str.gsub!(/\\ecirc((\{\})|\s|$)/, "&ecirc;")
+ str.gsub!(/\\Euml((\{\})|\s|$)/, "&Euml;")
+ str.gsub!(/\\euml((\{\})|\s|$)/, "&euml;")
+ str.gsub!(/\\Igrave((\{\})|\s|$)/, "&Igrave;")
+ str.gsub!(/\\igrave((\{\})|\s|$)/, "&igrave;")
+ str.gsub!(/\\Iacute((\{\})|\s|$)/, "&Iacute;")
+ str.gsub!(/\\iacute((\{\})|\s|$)/, "&iacute;")
+ str.gsub!(/\\Icirc((\{\})|\s|$)/, "&Icirc;")
+ str.gsub!(/\\icirc((\{\})|\s|$)/, "&icirc;")
+ str.gsub!(/\\Iuml((\{\})|\s|$)/, "&Iuml;")
+ str.gsub!(/\\iuml((\{\})|\s|$)/, "&iuml;")
+ str.gsub!(/\\Ntilde((\{\})|\s|$)/, "&Ntilde;")
+ str.gsub!(/\\ntilde((\{\})|\s|$)/, "&ntilde;")
+ str.gsub!(/\\Ograve((\{\})|\s|$)/, "&Ograve;")
+ str.gsub!(/\\ograve((\{\})|\s|$)/, "&ograve;")
+ str.gsub!(/\\Oacute((\{\})|\s|$)/, "&Oacute;")
+ str.gsub!(/\\oacute((\{\})|\s|$)/, "&oacute;")
+ str.gsub!(/\\Ocirc((\{\})|\s|$)/, "&Ocirc;")
+ str.gsub!(/\\ocirc((\{\})|\s|$)/, "&ocirc;")
+ str.gsub!(/\\Otilde((\{\})|\s|$)/, "&Otilde;")
+ str.gsub!(/\\otilde((\{\})|\s|$)/, "&otilde;")
+ str.gsub!(/\\Ouml((\{\})|\s|$)/, "&Ouml;")
+ str.gsub!(/\\ouml((\{\})|\s|$)/, "&ouml;")
+ str.gsub!(/\\Oslash((\{\})|\s|$)/, "&Oslash;")
+ str.gsub!(/\\oslash((\{\})|\s|$)/, "&oslash;")
+ str.gsub!(/\\OElig((\{\})|\s|$)/, "&OElig;")
+ str.gsub!(/\\oelig((\{\})|\s|$)/, "&oelig;")
+ str.gsub!(/\\Scaron((\{\})|\s|$)/, "&Scaron;")
+ str.gsub!(/\\scaron((\{\})|\s|$)/, "&scaron;")
+ str.gsub!(/\\szlig((\{\})|\s|$)/, "&szlig;")
+ str.gsub!(/\\Ugrave((\{\})|\s|$)/, "&Ugrave;")
+ str.gsub!(/\\ugrave((\{\})|\s|$)/, "&ugrave;")
+ str.gsub!(/\\Uacute((\{\})|\s|$)/, "&Uacute;")
+ str.gsub!(/\\uacute((\{\})|\s|$)/, "&uacute;")
+ str.gsub!(/\\Ucirc((\{\})|\s|$)/, "&Ucirc;")
+ str.gsub!(/\\ucirc((\{\})|\s|$)/, "&ucirc;")
+ str.gsub!(/\\Uuml((\{\})|\s|$)/, "&Uuml;")
+ str.gsub!(/\\uuml((\{\})|\s|$)/, "&uuml;")
+ str.gsub!(/\\Yacute((\{\})|\s|$)/, "&Yacute;")
+ str.gsub!(/\\yacute((\{\})|\s|$)/, "&yacute;")
+ str.gsub!(/\\Yuml((\{\})|\s|$)/, "&Yuml;")
+ str.gsub!(/\\yuml((\{\})|\s|$)/, "&yuml;")
+ str.gsub!(/\\fnof((\{\})|\s|$)/, "&fnof;")
+ str.gsub!(/\\real((\{\})|\s|$)/, "&real;")
+ str.gsub!(/\\image((\{\})|\s|$)/, "&image;")
+ str.gsub!(/\\weierp((\{\})|\s|$)/, "&weierp;")
+ str.gsub!(/\\Alpha((\{\})|\s|$)/, "&Alpha;")
+ str.gsub!(/\\alpha((\{\})|\s|$)/, "&alpha;")
+ str.gsub!(/\\Beta((\{\})|\s|$)/, "&Beta;")
+ str.gsub!(/\\beta((\{\})|\s|$)/, "&beta;")
+ str.gsub!(/\\Gamma((\{\})|\s|$)/, "&Gamma;")
+ str.gsub!(/\\gamma((\{\})|\s|$)/, "&gamma;")
+ str.gsub!(/\\Delta((\{\})|\s|$)/, "&Delta;")
+ str.gsub!(/\\delta((\{\})|\s|$)/, "&delta;")
+ str.gsub!(/\\Epsilon((\{\})|\s|$)/, "&Epsilon;")
+ str.gsub!(/\\epsilon((\{\})|\s|$)/, "&epsilon;")
+ str.gsub!(/\\varepsilon((\{\})|\s|$)/, "&epsilon;")
+ str.gsub!(/\\Zeta((\{\})|\s|$)/, "&Zeta;")
+ str.gsub!(/\\zeta((\{\})|\s|$)/, "&zeta;")
+ str.gsub!(/\\Eta((\{\})|\s|$)/, "&Eta;")
+ str.gsub!(/\\eta((\{\})|\s|$)/, "&eta;")
+ str.gsub!(/\\Theta((\{\})|\s|$)/, "&Theta;")
+ str.gsub!(/\\theta((\{\})|\s|$)/, "&theta;")
+ str.gsub!(/\\thetasym((\{\})|\s|$)/, "&thetasym;")
+ str.gsub!(/\\vartheta((\{\})|\s|$)/, "&thetasym;")
+ str.gsub!(/\\Iota((\{\})|\s|$)/, "&Iota;")
+ str.gsub!(/\\iota((\{\})|\s|$)/, "&iota;")
+ str.gsub!(/\\Kappa((\{\})|\s|$)/, "&Kappa;")
+ str.gsub!(/\\kappa((\{\})|\s|$)/, "&kappa;")
+ str.gsub!(/\\Lambda((\{\})|\s|$)/, "&Lambda;")
+ str.gsub!(/\\lambda((\{\})|\s|$)/, "&lambda;")
+ str.gsub!(/\\Mu((\{\})|\s|$)/, "&Mu;")
+ str.gsub!(/\\mu((\{\})|\s|$)/, "&mu;")
+ str.gsub!(/\\nu((\{\})|\s|$)/, "&nu;")
+ str.gsub!(/\\Nu((\{\})|\s|$)/, "&Nu;")
+ str.gsub!(/\\Xi((\{\})|\s|$)/, "&Xi;")
+ str.gsub!(/\\xi((\{\})|\s|$)/, "&xi;")
+ str.gsub!(/\\Omicron((\{\})|\s|$)/, "&Omicron;")
+ str.gsub!(/\\omicron((\{\})|\s|$)/, "&omicron;")
+ str.gsub!(/\\Pi((\{\})|\s|$)/, "&Pi;")
+ str.gsub!(/\\pi((\{\})|\s|$)/, "&pi;")
+ str.gsub!(/\\Rho((\{\})|\s|$)/, "&Rho;")
+ str.gsub!(/\\rho((\{\})|\s|$)/, "&rho;")
+ str.gsub!(/\\Sigma((\{\})|\s|$)/, "&Sigma;")
+ str.gsub!(/\\sigma((\{\})|\s|$)/, "&sigma;")
+ str.gsub!(/\\sigmaf((\{\})|\s|$)/, "&sigmaf;")
+ str.gsub!(/\\varsigma((\{\})|\s|$)/, "&sigmaf;")
+ str.gsub!(/\\Tau((\{\})|\s|$)/, "&Tau;")
+ str.gsub!(/\\Upsilon((\{\})|\s|$)/, "&Upsilon;")
+ str.gsub!(/\\upsih((\{\})|\s|$)/, "&upsih;")
+ str.gsub!(/\\upsilon((\{\})|\s|$)/, "&upsilon;")
+ str.gsub!(/\\Phi((\{\})|\s|$)/, "&Phi;")
+ str.gsub!(/\\phi((\{\})|\s|$)/, "&phi;")
+ str.gsub!(/\\Chi((\{\})|\s|$)/, "&Chi;")
+ str.gsub!(/\\chi((\{\})|\s|$)/, "&chi;")
+ str.gsub!(/\\acutex((\{\})|\s|$)/, "&acute;x")
+ str.gsub!(/\\Psi((\{\})|\s|$)/, "&Psi;")
+ str.gsub!(/\\psi((\{\})|\s|$)/, "&psi;")
+ str.gsub!(/\\tau((\{\})|\s|$)/, "&tau;")
+ str.gsub!(/\\Omega((\{\})|\s|$)/, "&Omega;")
+ str.gsub!(/\\omega((\{\})|\s|$)/, "&omega;")
+ str.gsub!(/\\piv((\{\})|\s|$)/, "&piv;")
+ str.gsub!(/\\partial((\{\})|\s|$)/, "&part;")
+ str.gsub!(/\\alefsym((\{\})|\s|$)/, "&alefsym;")
+ str.gsub!(/\\ETH((\{\})|\s|$)/, "&ETH;")
+ str.gsub!(/\\eth((\{\})|\s|$)/, "&eth;")
+ str.gsub!(/\\THORN((\{\})|\s|$)/, "&THORN;")
+ str.gsub!(/\\thorn((\{\})|\s|$)/, "&thorn;")
+ str.gsub!(/\\dots((\{\})|\s|$)/, "&hellip;")
+ str.gsub!(/\\hellip((\{\})|\s|$)/, "&hellip;")
+ str.gsub!(/\\middot((\{\})|\s|$)/, "&middot;")
+ str.gsub!(/\\iexcl((\{\})|\s|$)/, "&iexcl;")
+ str.gsub!(/\\iquest((\{\})|\s|$)/, "&iquest;")
+ str.gsub!(/\\shy((\{\})|\s|$)/, "&shy;")
+ str.gsub!(/\\ndash((\{\})|\s|$)/, "&ndash;")
+ str.gsub!(/\\mdash((\{\})|\s|$)/, "&mdash;")
+ str.gsub!(/\\quot((\{\})|\s|$)/, "&quot;")
+ str.gsub!(/\\acute((\{\})|\s|$)/, "&acute;")
+ str.gsub!(/\\ldquo((\{\})|\s|$)/, "&ldquo;")
+ str.gsub!(/\\rdquo((\{\})|\s|$)/, "&rdquo;")
+ str.gsub!(/\\bdquo((\{\})|\s|$)/, "&bdquo;")
+ str.gsub!(/\\lsquo((\{\})|\s|$)/, "&lsquo;")
+ str.gsub!(/\\rsquo((\{\})|\s|$)/, "&rsquo;")
+ str.gsub!(/\\sbquo((\{\})|\s|$)/, "&sbquo;")
+ str.gsub!(/\\laquo((\{\})|\s|$)/, "&laquo;")
+ str.gsub!(/\\raquo((\{\})|\s|$)/, "&raquo;")
+ str.gsub!(/\\lsaquo((\{\})|\s|$)/, "&lsaquo;")
+ str.gsub!(/\\rsaquo((\{\})|\s|$)/, "&rsaquo;")
+ str.gsub!(/\\circ((\{\})|\s|$)/, "&circ;")
+ str.gsub!(/\\vert((\{\})|\s|$)/, "&#124;")
+ str.gsub!(/\\brvbar((\{\})|\s|$)/, "&brvbar;")
+ str.gsub!(/\\sect((\{\})|\s|$)/, "&sect;")
+ str.gsub!(/\\amp((\{\})|\s|$)/, "&amp;")
+ str.gsub!(/\\lt((\{\})|\s|$)/, "&lt;")
+ str.gsub!(/\\gt((\{\})|\s|$)/, "&gt;")
+ str.gsub!(/\\tilde((\{\})|\s|$)/, "&tilde;")
+ str.gsub!(/\\dagger((\{\})|\s|$)/, "&dagger;")
+ str.gsub!(/\\Dagger((\{\})|\s|$)/, "&Dagger;")
+ str.gsub!(/\\nbsp((\{\})|\s|$)/, "&nbsp;")
+ str.gsub!(/\\ensp((\{\})|\s|$)/, "&ensp;")
+ str.gsub!(/\\emsp((\{\})|\s|$)/, "&emsp;")
+ str.gsub!(/\\thinsp((\{\})|\s|$)/, "&thinsp;")
+ str.gsub!(/\\curren((\{\})|\s|$)/, "&curren;")
+ str.gsub!(/\\cent((\{\})|\s|$)/, "&cent;")
+ str.gsub!(/\\pound((\{\})|\s|$)/, "&pound;")
+ str.gsub!(/\\yen((\{\})|\s|$)/, "&yen;")
+ str.gsub!(/\\euro((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\EUR((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\EURdig((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\EURhv((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\EURcr((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\EURtm((\{\})|\s|$)/, "&euro;")
+ str.gsub!(/\\copy((\{\})|\s|$)/, "&copy;")
+ str.gsub!(/\\reg((\{\})|\s|$)/, "&reg;")
+ str.gsub!(/\\trade((\{\})|\s|$)/, "&trade;")
+ str.gsub!(/\\minus((\{\})|\s|$)/, "&minus;")
+ str.gsub!(/\\pm((\{\})|\s|$)/, "&plusmn;")
+ str.gsub!(/\\plusmn((\{\})|\s|$)/, "&plusmn;")
+ str.gsub!(/\\times((\{\})|\s|$)/, "&times;")
+ str.gsub!(/\\frasl((\{\})|\s|$)/, "&frasl;")
+ str.gsub!(/\\div((\{\})|\s|$)/, "&divide;")
+ str.gsub!(/\\frac12((\{\})|\s|$)/, "&frac12;")
+ str.gsub!(/\\frac14((\{\})|\s|$)/, "&frac14;")
+ str.gsub!(/\\frac34((\{\})|\s|$)/, "&frac34;")
+ str.gsub!(/\\permil((\{\})|\s|$)/, "&permil;")
+ str.gsub!(/\\sup1((\{\})|\s|$)/, "&sup1;")
+ str.gsub!(/\\sup2((\{\})|\s|$)/, "&sup2;")
+ str.gsub!(/\\sup3((\{\})|\s|$)/, "&sup3;")
+ str.gsub!(/\\radic((\{\})|\s|$)/, "&radic;")
+ str.gsub!(/\\sum((\{\})|\s|$)/, "&sum;")
+ str.gsub!(/\\prod((\{\})|\s|$)/, "&prod;")
+ str.gsub!(/\\micro((\{\})|\s|$)/, "&micro;")
+ str.gsub!(/\\macr((\{\})|\s|$)/, "&macr;")
+ str.gsub!(/\\deg((\{\})|\s|$)/, "&deg;")
+ str.gsub!(/\\prime((\{\})|\s|$)/, "&prime;")
+ str.gsub!(/\\Prime((\{\})|\s|$)/, "&Prime;")
+ str.gsub!(/\\infin((\{\})|\s|$)/, "&infin;")
+ str.gsub!(/\\infty((\{\})|\s|$)/, "&infin;")
+ str.gsub!(/\\prop((\{\})|\s|$)/, "&prop;")
+ str.gsub!(/\\proptp((\{\})|\s|$)/, "&prop;")
+ str.gsub!(/\\not((\{\})|\s|$)/, "&not;")
+ str.gsub!(/\\land((\{\})|\s|$)/, "&and;")
+ str.gsub!(/\\wedge((\{\})|\s|$)/, "&and;")
+ str.gsub!(/\\lor((\{\})|\s|$)/, "&or;")
+ str.gsub!(/\\vee((\{\})|\s|$)/, "&or;")
+ str.gsub!(/\\cap((\{\})|\s|$)/, "&cap;")
+ str.gsub!(/\\cup((\{\})|\s|$)/, "&cup;")
+ str.gsub!(/\\int((\{\})|\s|$)/, "&int;")
+ str.gsub!(/\\there4((\{\})|\s|$)/, "&there4;")
+ str.gsub!(/\\sim((\{\})|\s|$)/, "&sim;")
+ str.gsub!(/\\cong((\{\})|\s|$)/, "&cong;")
+ str.gsub!(/\\simeq((\{\})|\s|$)/, "&cong;")
+ str.gsub!(/\\asymp((\{\})|\s|$)/, "&asymp;")
+ str.gsub!(/\\approx((\{\})|\s|$)/, "&asymp;")
+ str.gsub!(/\\ne((\{\})|\s|$)/, "&ne;")
+ str.gsub!(/\\neq((\{\})|\s|$)/, "&ne;")
+ str.gsub!(/\\equiv((\{\})|\s|$)/, "&equiv;")
+ str.gsub!(/\\le((\{\})|\s|$)/, "&le;")
+ str.gsub!(/\\ge((\{\})|\s|$)/, "&ge;")
+ str.gsub!(/\\sub((\{\})|\s|$)/, "&sub;")
+ str.gsub!(/\\subset((\{\})|\s|$)/, "&sub;")
+ str.gsub!(/\\sup((\{\})|\s|$)/, "&sup;")
+ str.gsub!(/\\supset((\{\})|\s|$)/, "&sup;")
+ str.gsub!(/\\nsub((\{\})|\s|$)/, "&nsub;")
+ str.gsub!(/\\sube((\{\})|\s|$)/, "&sube;")
+ str.gsub!(/\\nsup((\{\})|\s|$)/, "&nsup;")
+ str.gsub!(/\\supe((\{\})|\s|$)/, "&supe;")
+ str.gsub!(/\\forall((\{\})|\s|$)/, "&forall;")
+ str.gsub!(/\\exist((\{\})|\s|$)/, "&exist;")
+ str.gsub!(/\\exists((\{\})|\s|$)/, "&exist;")
+ str.gsub!(/\\empty((\{\})|\s|$)/, "&empty;")
+ str.gsub!(/\\emptyset((\{\})|\s|$)/, "&empty;")
+ str.gsub!(/\\isin((\{\})|\s|$)/, "&isin;")
+ str.gsub!(/\\in((\{\})|\s|$)/, "&isin;")
+ str.gsub!(/\\notin((\{\})|\s|$)/, "&notin;")
+ str.gsub!(/\\ni((\{\})|\s|$)/, "&ni;")
+ str.gsub!(/\\nabla((\{\})|\s|$)/, "&nabla;")
+ str.gsub!(/\\ang((\{\})|\s|$)/, "&ang;")
+ str.gsub!(/\\angle((\{\})|\s|$)/, "&ang;")
+ str.gsub!(/\\perp((\{\})|\s|$)/, "&perp;")
+ str.gsub!(/\\sdot((\{\})|\s|$)/, "&sdot;")
+ str.gsub!(/\\cdot((\{\})|\s|$)/, "&sdot;")
+ str.gsub!(/\\lceil((\{\})|\s|$)/, "&lceil;")
+ str.gsub!(/\\rceil((\{\})|\s|$)/, "&rceil;")
+ str.gsub!(/\\lfloor((\{\})|\s|$)/, "&lfloor;")
+ str.gsub!(/\\rfloor((\{\})|\s|$)/, "&rfloor;")
+ str.gsub!(/\\lang((\{\})|\s|$)/, "&lang;")
+ str.gsub!(/\\rang((\{\})|\s|$)/, "&rang;")
+ str.gsub!(/\\larr((\{\})|\s|$)/, "&larr;")
+ str.gsub!(/\\leftarrow((\{\})|\s|$)/, "&larr;")
+ str.gsub!(/\\gets((\{\})|\s|$)/, "&larr;")
+ str.gsub!(/\\lArr((\{\})|\s|$)/, "&lArr;")
+ str.gsub!(/\\Leftarrow((\{\})|\s|$)/, "&lArr;")
+ str.gsub!(/\\uarr((\{\})|\s|$)/, "&uarr;")
+ str.gsub!(/\\uparrow((\{\})|\s|$)/, "&uarr;")
+ str.gsub!(/\\uArr((\{\})|\s|$)/, "&uArr;")
+ str.gsub!(/\\Uparrow((\{\})|\s|$)/, "&uArr;")
+ str.gsub!(/\\rarr((\{\})|\s|$)/, "&rarr;")
+ str.gsub!(/\\to((\{\})|\s|$)/, "&rarr;")
+ str.gsub!(/\\rightarrow((\{\})|\s|$)/, "&rarr;")
+ str.gsub!(/\\rArr((\{\})|\s|$)/, "&rArr;")
+ str.gsub!(/\\Rightarrow((\{\})|\s|$)/, "&rArr;")
+ str.gsub!(/\\darr((\{\})|\s|$)/, "&darr;")
+ str.gsub!(/\\downarrow((\{\})|\s|$)/, "&darr;")
+ str.gsub!(/\\dArr((\{\})|\s|$)/, "&dArr;")
+ str.gsub!(/\\Downarrow((\{\})|\s|$)/, "&dArr;")
+ str.gsub!(/\\harr((\{\})|\s|$)/, "&harr;")
+ str.gsub!(/\\leftrightarrow((\{\})|\s|$)/, "&harr;")
+ str.gsub!(/\\hArr((\{\})|\s|$)/, "&hArr;")
+ str.gsub!(/\\Leftrightarrow((\{\})|\s|$)/, "&hArr;")
+ str.gsub!(/\\crarr((\{\})|\s|$)/, "&crarr;")
+ str.gsub!(/\\hookleftarrow((\{\})|\s|$)/, "&crarr;")
+ str.gsub!(/\\arccos((\{\})|\s|$)/, "arccos")
+ str.gsub!(/\\arcsin((\{\})|\s|$)/, "arcsin")
+ str.gsub!(/\\arctan((\{\})|\s|$)/, "arctan")
+ str.gsub!(/\\arg((\{\})|\s|$)/, "arg")
+ str.gsub!(/\\cos((\{\})|\s|$)/, "cos")
+ str.gsub!(/\\cosh((\{\})|\s|$)/, "cosh")
+ str.gsub!(/\\cot((\{\})|\s|$)/, "cot")
+ str.gsub!(/\\coth((\{\})|\s|$)/, "coth")
+ str.gsub!(/\\csc((\{\})|\s|$)/, "csc")
+ str.gsub!(/\\deg((\{\})|\s|$)/, "&deg;")
+ str.gsub!(/\\det((\{\})|\s|$)/, "det")
+ str.gsub!(/\\dim((\{\})|\s|$)/, "dim")
+ str.gsub!(/\\exp((\{\})|\s|$)/, "exp")
+ str.gsub!(/\\gcd((\{\})|\s|$)/, "gcd")
+ str.gsub!(/\\hom((\{\})|\s|$)/, "hom")
+ str.gsub!(/\\inf((\{\})|\s|$)/, "inf")
+ str.gsub!(/\\ker((\{\})|\s|$)/, "ker")
+ str.gsub!(/\\lg((\{\})|\s|$)/, "lg")
+ str.gsub!(/\\lim((\{\})|\s|$)/, "lim")
+ str.gsub!(/\\liminf((\{\})|\s|$)/, "liminf")
+ str.gsub!(/\\limsup((\{\})|\s|$)/, "limsup")
+ str.gsub!(/\\ln((\{\})|\s|$)/, "ln")
+ str.gsub!(/\\log((\{\})|\s|$)/, "log")
+ str.gsub!(/\\max((\{\})|\s|$)/, "max")
+ str.gsub!(/\\min((\{\})|\s|$)/, "min")
+ str.gsub!(/\\Pr((\{\})|\s|$)/, "Pr")
+ str.gsub!(/\\sec((\{\})|\s|$)/, "sec")
+ str.gsub!(/\\sin((\{\})|\s|$)/, "sin")
+ str.gsub!(/\\sinh((\{\})|\s|$)/, "sinh")
+ str.gsub!(/\\sup((\{\})|\s|$)/, "&sup;")
+ str.gsub!(/\\tan((\{\})|\s|$)/, "tan")
+ str.gsub!(/\\tanh((\{\})|\s|$)/, "tanh")
+ str.gsub!(/\\bull((\{\})|\s|$)/, "&bull;")
+ str.gsub!(/\\bullet((\{\})|\s|$)/, "&bull;")
+ str.gsub!(/\\star((\{\})|\s|$)/, "*")
+ str.gsub!(/\\lowast((\{\})|\s|$)/, "&lowast;")
+ str.gsub!(/\\ast((\{\})|\s|$)/, "&lowast;")
+ str.gsub!(/\\odot((\{\})|\s|$)/, "o")
+ str.gsub!(/\\oplus((\{\})|\s|$)/, "&oplus;")
+ str.gsub!(/\\otimes((\{\})|\s|$)/, "&otimes;")
+ str.gsub!(/\\checkmark((\{\})|\s|$)/, "&#10003;")
+ str.gsub!(/\\para((\{\})|\s|$)/, "&para;")
+ str.gsub!(/\\ordf((\{\})|\s|$)/, "&ordf;")
+ str.gsub!(/\\ordm((\{\})|\s|$)/, "&ordm;")
+ str.gsub!(/\\cedil((\{\})|\s|$)/, "&cedil;")
+ str.gsub!(/\\oline((\{\})|\s|$)/, "&oline;")
+ str.gsub!(/\\uml((\{\})|\s|$)/, "&uml;")
+ str.gsub!(/\\zwnj((\{\})|\s|$)/, "&zwnj;")
+ str.gsub!(/\\zwj((\{\})|\s|$)/, "&zwj;")
+ str.gsub!(/\\lrm((\{\})|\s|$)/, "&lrm;")
+ str.gsub!(/\\rlm((\{\})|\s|$)/, "&rlm;")
+ str.gsub!(/\\smile((\{\})|\s|$)/, "&#9786;")
+ str.gsub!(/\\smiley((\{\})|\s|$)/, "&#9786;")
+ str.gsub!(/\\blacksmile((\{\})|\s|$)/, "&#9787;")
+ str.gsub!(/\\sad((\{\})|\s|$)/, "&#9785;")
+ str.gsub!(/\\clubs((\{\})|\s|$)/, "&clubs;")
+ str.gsub!(/\\clubsuit((\{\})|\s|$)/, "&clubs;")
+ str.gsub!(/\\spades((\{\})|\s|$)/, "&spades;")
+ str.gsub!(/\\spadesuit((\{\})|\s|$)/, "&spades;")
+ str.gsub!(/\\hearts((\{\})|\s|$)/, "&hearts;")
+ str.gsub!(/\\heartsuit((\{\})|\s|$)/, "&heartsuit;")
+ str.gsub!(/\\diams((\{\})|\s|$)/, "&diams;")
+ str.gsub!(/\\diamondsuit((\{\})|\s|$)/, "&diams;")
+ str.gsub!(/\\Diamond((\{\})|\s|$)/, "&diamond;")
+ str.gsub!(/\\loz((\{\})|\s|$)/, "&loz;")
+ end
+end # module Orgmode
View
1 lib/org-ruby/textile_output_buffer.rb
@@ -58,6 +58,7 @@ def inline_formatting(input)
@footnotes[name] = defi if defi
"[#{name}]"
end
+ Orgmode.special_symbols_to_textile(input)
input
end
View
346 lib/org-ruby/textile_symbol_replace.rb
@@ -0,0 +1,346 @@
+# -*- coding: utf-8 -*-
+# Autogenerated by util/gen-special-replace.el
+
+module Orgmode
+ def Orgmode.special_symbols_to_textile(str)
+ str.gsub!(/\\Agrave((\{\})|\s|$)/, "À")
+ str.gsub!(/\\agrave((\{\})|\s|$)/, "à")
+ str.gsub!(/\\Aacute((\{\})|\s|$)/, "Á")
+ str.gsub!(/\\aacute((\{\})|\s|$)/, "á")
+ str.gsub!(/\\Acirc((\{\})|\s|$)/, "Â")
+ str.gsub!(/\\acirc((\{\})|\s|$)/, "â")
+ str.gsub!(/\\Atilde((\{\})|\s|$)/, "Ã")
+ str.gsub!(/\\atilde((\{\})|\s|$)/, "ã")
+ str.gsub!(/\\Auml((\{\})|\s|$)/, "Ä")
+ str.gsub!(/\\auml((\{\})|\s|$)/, "ä")
+ str.gsub!(/\\Aring((\{\})|\s|$)/, "Å")
+ str.gsub!(/\\AA((\{\})|\s|$)/, "Å")
+ str.gsub!(/\\aring((\{\})|\s|$)/, "å")
+ str.gsub!(/\\AElig((\{\})|\s|$)/, "Æ")
+ str.gsub!(/\\aelig((\{\})|\s|$)/, "æ")
+ str.gsub!(/\\Ccedil((\{\})|\s|$)/, "Ç")
+ str.gsub!(/\\ccedil((\{\})|\s|$)/, "ç")
+ str.gsub!(/\\Egrave((\{\})|\s|$)/, "È")
+ str.gsub!(/\\egrave((\{\})|\s|$)/, "è")
+ str.gsub!(/\\Eacute((\{\})|\s|$)/, "É")
+ str.gsub!(/\\eacute((\{\})|\s|$)/, "é")
+ str.gsub!(/\\Ecirc((\{\})|\s|$)/, "Ê")
+ str.gsub!(/\\ecirc((\{\})|\s|$)/, "ê")
+ str.gsub!(/\\Euml((\{\})|\s|$)/, "Ë")
+ str.gsub!(/\\euml((\{\})|\s|$)/, "ë")
+ str.gsub!(/\\Igrave((\{\})|\s|$)/, "Ì")
+ str.gsub!(/\\igrave((\{\})|\s|$)/, "ì")
+ str.gsub!(/\\Iacute((\{\})|\s|$)/, "Í")
+ str.gsub!(/\\iacute((\{\})|\s|$)/, "í")
+ str.gsub!(/\\Icirc((\{\})|\s|$)/, "Î")
+ str.gsub!(/\\icirc((\{\})|\s|$)/, "î")
+ str.gsub!(/\\Iuml((\{\})|\s|$)/, "Ï")
+ str.gsub!(/\\iuml((\{\})|\s|$)/, "ï")
+ str.gsub!(/\\Ntilde((\{\})|\s|$)/, "Ñ")
+ str.gsub!(/\\ntilde((\{\})|\s|$)/, "ñ")
+ str.gsub!(/\\Ograve((\{\})|\s|$)/, "Ò")
+ str.gsub!(/\\ograve((\{\})|\s|$)/, "ò")
+ str.gsub!(/\\Oacute((\{\})|\s|$)/, "Ó")
+ str.gsub!(/\\oacute((\{\})|\s|$)/, "ó")
+ str.gsub!(/\\Ocirc((\{\})|\s|$)/, "Ô")
+ str.gsub!(/\\ocirc((\{\})|\s|$)/, "ô")
+ str.gsub!(/\\Otilde((\{\})|\s|$)/, "Õ")
+ str.gsub!(/\\otilde((\{\})|\s|$)/, "õ")
+ str.gsub!(/\\Ouml((\{\})|\s|$)/, "Ö")
+ str.gsub!(/\\ouml((\{\})|\s|$)/, "ö")
+ str.gsub!(/\\Oslash((\{\})|\s|$)/, "Ø")
+ str.gsub!(/\\oslash((\{\})|\s|$)/, "ø")
+ str.gsub!(/\\OElig((\{\})|\s|$)/, "Œ")
+ str.gsub!(/\\oelig((\{\})|\s|$)/, "œ")
+ str.gsub!(/\\Scaron((\{\})|\s|$)/, "Š")
+ str.gsub!(/\\scaron((\{\})|\s|$)/, "š")
+ str.gsub!(/\\szlig((\{\})|\s|$)/, "ß")
+ str.gsub!(/\\Ugrave((\{\})|\s|$)/, "Ù")
+ str.gsub!(/\\ugrave((\{\})|\s|$)/, "ù")
+ str.gsub!(/\\Uacute((\{\})|\s|$)/, "Ú")
+ str.gsub!(/\\uacute((\{\})|\s|$)/, "ú")
+ str.gsub!(/\\Ucirc((\{\})|\s|$)/, "Û")
+ str.gsub!(/\\ucirc((\{\})|\s|$)/, "û")
+ str.gsub!(/\\Uuml((\{\})|\s|$)/, "Ü")
+ str.gsub!(/\\uuml((\{\})|\s|$)/, "ü")
+ str.gsub!(/\\Yacute((\{\})|\s|$)/, "Ý")
+ str.gsub!(/\\yacute((\{\})|\s|$)/, "ý")
+ str.gsub!(/\\Yuml((\{\})|\s|$)/, "Ÿ")
+ str.gsub!(/\\yuml((\{\})|\s|$)/, "ÿ")
+ str.gsub!(/\\fnof((\{\})|\s|$)/, "ƒ")
+ str.gsub!(/\\real((\{\})|\s|$)/, "")
+ str.gsub!(/\\image((\{\})|\s|$)/, "")
+ str.gsub!(/\\weierp((\{\})|\s|$)/, "")
+ str.gsub!(/\\Alpha((\{\})|\s|$)/, "Α")
+ str.gsub!(/\\alpha((\{\})|\s|$)/, "α")
+ str.gsub!(/\\Beta((\{\})|\s|$)/, "Β")
+ str.gsub!(/\\beta((\{\})|\s|$)/, "β")
+ str.gsub!(/\\Gamma((\{\})|\s|$)/, "Γ")
+ str.gsub!(/\\gamma((\{\})|\s|$)/, "γ")
+ str.gsub!(/\\Delta((\{\})|\s|$)/, "Δ")
+ str.gsub!(/\\delta((\{\})|\s|$)/, "δ")
+ str.gsub!(/\\Epsilon((\{\})|\s|$)/, "Ε")
+ str.gsub!(/\\epsilon((\{\})|\s|$)/, "ε")
+ str.gsub!(/\\varepsilon((\{\})|\s|$)/, "ε")
+ str.gsub!(/\\Zeta((\{\})|\s|$)/, "Ζ")
+ str.gsub!(/\\zeta((\{\})|\s|$)/, "ζ")
+ str.gsub!(/\\Eta((\{\})|\s|$)/, "Η")
+ str.gsub!(/\\eta((\{\})|\s|$)/, "η")
+ str.gsub!(/\\Theta((\{\})|\s|$)/, "Θ")
+ str.gsub!(/\\theta((\{\})|\s|$)/, "θ")
+ str.gsub!(/\\thetasym((\{\})|\s|$)/, "ϑ")
+ str.gsub!(/\\vartheta((\{\})|\s|$)/, "ϑ")
+ str.gsub!(/\\Iota((\{\})|\s|$)/, "Ι")
+ str.gsub!(/\\iota((\{\})|\s|$)/, "ι")
+ str.gsub!(/\\Kappa((\{\})|\s|$)/, "Κ")
+ str.gsub!(/\\kappa((\{\})|\s|$)/, "κ")
+ str.gsub!(/\\Lambda((\{\})|\s|$)/, "Λ")
+ str.gsub!(/\\lambda((\{\})|\s|$)/, "λ")
+ str.gsub!(/\\Mu((\{\})|\s|$)/, "Μ")
+ str.gsub!(/\\mu((\{\})|\s|$)/, "μ")
+ str.gsub!(/\\nu((\{\})|\s|$)/, "ν")
+ str.gsub!(/\\Nu((\{\})|\s|$)/, "Ν")
+ str.gsub!(/\\Xi((\{\})|\s|$)/, "Ξ")
+ str.gsub!(/\\xi((\{\})|\s|$)/, "ξ")
+ str.gsub!(/\\Omicron((\{\})|\s|$)/, "Ο")
+ str.gsub!(/\\omicron((\{\})|\s|$)/, "ο")
+ str.gsub!(/\\Pi((\{\})|\s|$)/, "Π")
+ str.gsub!(/\\pi((\{\})|\s|$)/, "π")
+ str.gsub!(/\\Rho((\{\})|\s|$)/, "Ρ")
+ str.gsub!(/\\rho((\{\})|\s|$)/, "ρ")
+ str.gsub!(/\\Sigma((\{\})|\s|$)/, "Σ")
+ str.gsub!(/\\sigma((\{\})|\s|$)/, "σ")
+ str.gsub!(/\\sigmaf((\{\})|\s|$)/, "ς")
+ str.gsub!(/\\varsigma((\{\})|\s|$)/, "ς")
+ str.gsub!(/\\Tau((\{\})|\s|$)/, "Τ")
+ str.gsub!(/\\Upsilon((\{\})|\s|$)/, "Υ")
+ str.gsub!(/\\upsih((\{\})|\s|$)/, "ϒ")
+ str.gsub!(/\\upsilon((\{\})|\s|$)/, "υ")
+ str.gsub!(/\\Phi((\{\})|\s|$)/, "Φ")
+ str.gsub!(/\\phi((\{\})|\s|$)/, "φ")
+ str.gsub!(/\\Chi((\{\})|\s|$)/, "Χ")
+ str.gsub!(/\\chi((\{\})|\s|$)/, "χ")
+ str.gsub!(/\\acutex((\{\})|\s|$)/, "𝑥́")
+ str.gsub!(/\\Psi((\{\})|\s|$)/, "Ψ")
+ str.gsub!(/\\psi((\{\})|\s|$)/, "ψ")
+ str.gsub!(/\\tau((\{\})|\s|$)/, "τ")
+ str.gsub!(/\\Omega((\{\})|\s|$)/, "Ω")
+ str.gsub!(/\\omega((\{\})|\s|$)/, "ω")
+ str.gsub!(/\\piv((\{\})|\s|$)/, "ϖ")
+ str.gsub!(/\\partial((\{\})|\s|$)/, "")
+ str.gsub!(/\\alefsym((\{\})|\s|$)/, "")
+ str.gsub!(/\\ETH((\{\})|\s|$)/, "Ð")
+ str.gsub!(/\\eth((\{\})|\s|$)/, "ð")
+ str.gsub!(/\\THORN((\{\})|\s|$)/, "Þ")
+ str.gsub!(/\\thorn((\{\})|\s|$)/, "þ")
+ str.gsub!(/\\dots((\{\})|\s|$)/, "")
+ str.gsub!(/\\hellip((\{\})|\s|$)/, "")
+ str.gsub!(/\\middot((\{\})|\s|$)/, "·")
+ str.gsub!(/\\iexcl((\{\})|\s|$)/, "¡")
+ str.gsub!(/\\iquest((\{\})|\s|$)/, "¿")
+ str.gsub!(/\\shy((\{\})|\s|$)/, "")
+ str.gsub!(/\\ndash((\{\})|\s|$)/, "")
+ str.gsub!(/\\mdash((\{\})|\s|$)/, "")
+ str.gsub!(/\\quot((\{\})|\s|$)/, "\"")
+ str.gsub!(/\\acute((\{\})|\s|$)/, "´")
+ str.gsub!(/\\ldquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\rdquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\bdquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\lsquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\rsquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\sbquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\laquo((\{\})|\s|$)/, "«")
+ str.gsub!(/\\raquo((\{\})|\s|$)/, "»")
+ str.gsub!(/\\lsaquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\rsaquo((\{\})|\s|$)/, "")
+ str.gsub!(/\\circ((\{\})|\s|$)/, "ˆ")
+ str.gsub!(/\\vert((\{\})|\s|$)/, "|")
+ str.gsub!(/\\brvbar((\{\})|\s|$)/, "¦")
+ str.gsub!(/\\sect((\{\})|\s|$)/, "§")
+ str.gsub!(/\\amp((\{\})|\s|$)/, "&")
+ str.gsub!(/\\lt((\{\})|\s|$)/, "<")
+ str.gsub!(/\\gt((\{\})|\s|$)/, ">")
+ str.gsub!(/\\tilde((\{\})|\s|$)/, "~")
+ str.gsub!(/\\dagger((\{\})|\s|$)/, "")
+ str.gsub!(/\\Dagger((\{\})|\s|$)/, "")
+ str.gsub!(/\\nbsp((\{\})|\s|$)/, " ")
+ str.gsub!(/\\ensp((\{\})|\s|$)/, "")
+ str.gsub!(/\\emsp((\{\})|\s|$)/, "")
+ str.gsub!(/\\thinsp((\{\})|\s|$)/, "")
+ str.gsub!(/\\curren((\{\})|\s|$)/, "¤")
+ str.gsub!(/\\cent((\{\})|\s|$)/, "¢")
+ str.gsub!(/\\pound((\{\})|\s|$)/, "£")
+ str.gsub!(/\\yen((\{\})|\s|$)/, "¥")
+ str.gsub!(/\\euro((\{\})|\s|$)/, "")
+ str.gsub!(/\\EUR((\{\})|\s|$)/, "")
+ str.gsub!(/\\EURdig((\{\})|\s|$)/, "")
+ str.gsub!(/\\EURhv((\{\})|\s|$)/, "")
+ str.gsub!(/\\EURcr((\{\})|\s|$)/, "")
+ str.gsub!(/\\EURtm((\{\})|\s|$)/, "")
+ str.gsub!(/\\copy((\{\})|\s|$)/, "©")
+ str.gsub!(/\\reg((\{\})|\s|$)/, "®")
+ str.gsub!(/\\trade((\{\})|\s|$)/, "")
+ str.gsub!(/\\minus((\{\})|\s|$)/, "")
+ str.gsub!(/\\pm((\{\})|\s|$)/, "±")
+ str.gsub!(/\\plusmn((\{\})|\s|$)/, "±")
+ str.gsub!(/\\times((\{\})|\s|$)/, "×")
+ str.gsub!(/\\frasl((\{\})|\s|$)/, "")
+ str.gsub!(/\\div((\{\})|\s|$)/, "÷")
+ str.gsub!(/\\frac12((\{\})|\s|$)/, "½")
+ str.gsub!(/\\frac14((\{\})|\s|$)/, "¼")
+ str.gsub!(/\\frac34((\{\})|\s|$)/, "¾")
+ str.gsub!(/\\permil((\{\})|\s|$)/, "")
+ str.gsub!(/\\sup1((\{\})|\s|$)/, "¹")
+ str.gsub!(/\\sup2((\{\})|\s|$)/, "²")
+ str.gsub!(/\\sup3((\{\})|\s|$)/, "³")
+ str.gsub!(/\\radic((\{\})|\s|$)/, "")
+ str.gsub!(/\\sum((\{\})|\s|$)/, "")
+ str.gsub!(/\\prod((\{\})|\s|$)/, "")
+ str.gsub!(/\\micro((\{\})|\s|$)/, "µ")
+ str.gsub!(/\\macr((\{\})|\s|$)/, "¯")
+ str.gsub!(/\\deg((\{\})|\s|$)/, "°")
+ str.gsub!(/\\prime((\{\})|\s|$)/, "")
+ str.gsub!(/\\Prime((\{\})|\s|$)/, "")
+ str.gsub!(/\\infin((\{\})|\s|$)/, "")
+ str.gsub!(/\\infty((\{\})|\s|$)/, "")
+ str.gsub!(/\\prop((\{\})|\s|$)/, "")
+ str.gsub!(/\\proptp((\{\})|\s|$)/, "")
+ str.gsub!(/\\not((\{\})|\s|$)/, "¬")
+ str.gsub!(/\\land((\{\})|\s|$)/, "")
+ str.gsub!(/\\wedge((\{\})|\s|$)/, "")
+ str.gsub!(/\\lor((\{\})|\s|$)/, "")
+ str.gsub!(/\\vee((\{\})|\s|$)/, "")
+ str.gsub!(/\\cap((\{\})|\s|$)/, "")
+ str.gsub!(/\\cup((\{\})|\s|$)/, "")
+ str.gsub!(/\\int((\{\})|\s|$)/, "")
+ str.gsub!(/\\there4((\{\})|\s|$)/, "")
+ str.gsub!(/\\sim((\{\})|\s|$)/, "")
+ str.gsub!(/\\cong((\{\})|\s|$)/, "")
+ str.gsub!(/\\simeq((\{\})|\s|$)/, "")
+ str.gsub!(/\\asymp((\{\})|\s|$)/, "")
+ str.gsub!(/\\approx((\{\})|\s|$)/, "")
+ str.gsub!(/\\ne((\{\})|\s|$)/, "")
+ str.gsub!(/\\neq((\{\})|\s|$)/, "")
+ str.gsub!(/\\equiv((\{\})|\s|$)/, "")
+ str.gsub!(/\\le((\{\})|\s|$)/, "")
+ str.gsub!(/\\ge((\{\})|\s|$)/, "")
+ str.gsub!(/\\sub((\{\})|\s|$)/, "")
+ str.gsub!(/\\subset((\{\})|\s|$)/, "")
+ str.gsub!(/\\sup((\{\})|\s|$)/, "")
+ str.gsub!(/\\supset((\{\})|\s|$)/, "")
+ str.gsub!(/\\nsub((\{\})|\s|$)/, "")
+ str.gsub!(/\\sube((\{\})|\s|$)/, "")
+ str.gsub!(/\\nsup((\{\})|\s|$)/, "")
+ str.gsub!(/\\supe((\{\})|\s|$)/, "")
+ str.gsub!(/\\forall((\{\})|\s|$)/, "")
+ str.gsub!(/\\exist((\{\})|\s|$)/, "")
+ str.gsub!(/\\exists((\{\})|\s|$)/, "")
+ str.gsub!(/\\empty((\{\})|\s|$)/, "")
+ str.gsub!(/\\emptyset((\{\})|\s|$)/, "")
+ str.gsub!(/\\isin((\{\})|\s|$)/, "")
+ str.gsub!(/\\in((\{\})|\s|$)/, "")
+ str.gsub!(/\\notin((\{\})|\s|$)/, "")
+ str.gsub!(/\\ni((\{\})|\s|$)/, "")
+ str.gsub!(/\\nabla((\{\})|\s|$)/, "")
+ str.gsub!(/\\ang((\{\})|\s|$)/, "")
+ str.gsub!(/\\angle((\{\})|\s|$)/, "")
+ str.gsub!(/\\perp((\{\})|\s|$)/, "")
+ str.gsub!(/\\sdot((\{\})|\s|$)/, "")
+ str.gsub!(/\\cdot((\{\})|\s|$)/, "")
+ str.gsub!(/\\lceil((\{\})|\s|$)/, "")
+ str.gsub!(/\\rceil((\{\})|\s|$)/, "")
+ str.gsub!(/\\lfloor((\{\})|\s|$)/, "")
+ str.gsub!(/\\rfloor((\{\})|\s|$)/, "")
+ str.gsub!(/\\lang((\{\})|\s|$)/, "")
+ str.gsub!(/\\rang((\{\})|\s|$)/, "")
+ str.gsub!(/\\larr((\{\})|\s|$)/, "")
+ str.gsub!(/\\leftarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\gets((\{\})|\s|$)/, "")
+ str.gsub!(/\\lArr((\{\})|\s|$)/, "")
+ str.gsub!(/\\Leftarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\uarr((\{\})|\s|$)/, "")
+ str.gsub!(/\\uparrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\uArr((\{\})|\s|$)/, "")
+ str.gsub!(/\\Uparrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\rarr((\{\})|\s|$)/, "")
+ str.gsub!(/\\to((\{\})|\s|$)/, "")
+ str.gsub!(/\\rightarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\rArr((\{\})|\s|$)/, "")
+ str.gsub!(/\\Rightarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\darr((\{\})|\s|$)/, "")
+ str.gsub!(/\\downarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\dArr((\{\})|\s|$)/, "")
+ str.gsub!(/\\Downarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\harr((\{\})|\s|$)/, "")
+ str.gsub!(/\\leftrightarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\hArr((\{\})|\s|$)/, "")
+ str.gsub!(/\\Leftrightarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\crarr((\{\})|\s|$)/, "")
+ str.gsub!(/\\hookleftarrow((\{\})|\s|$)/, "")
+ str.gsub!(/\\arccos((\{\})|\s|$)/, "arccos")
+ str.gsub!(/\\arcsin((\{\})|\s|$)/, "arcsin")
+ str.gsub!(/\\arctan((\{\})|\s|$)/, "arctan")
+ str.gsub!(/\\arg((\{\})|\s|$)/, "arg")
+ str.gsub!(/\\cos((\{\})|\s|$)/, "cos")
+ str.gsub!(/\\cosh((\{\})|\s|$)/, "cosh")
+ str.gsub!(/\\cot((\{\})|\s|$)/, "cot")
+ str.gsub!(/\\coth((\{\})|\s|$)/, "coth")
+ str.gsub!(/\\csc((\{\})|\s|$)/, "csc")
+ str.gsub!(/\\deg((\{\})|\s|$)/, "deg")
+ str.gsub!(/\\det((\{\})|\s|$)/, "det")
+ str.gsub!(/\\dim((\{\})|\s|$)/, "dim")
+ str.gsub!(/\\exp((\{\})|\s|$)/, "exp")
+ str.gsub!(/\\gcd((\{\})|\s|$)/, "gcd")
+ str.gsub!(/\\hom((\{\})|\s|$)/, "hom")
+ str.gsub!(/\\inf((\{\})|\s|$)/, "inf")
+ str.gsub!(/\\ker((\{\})|\s|$)/, "ker")
+ str.gsub!(/\\lg((\{\})|\s|$)/, "lg")
+ str.gsub!(/\\lim((\{\})|\s|$)/, "lim")
+ str.gsub!(/\\liminf((\{\})|\s|$)/, "liminf")
+ str.gsub!(/\\limsup((\{\})|\s|$)/, "limsup")
+ str.gsub!(/\\ln((\{\})|\s|$)/, "ln")
+ str.gsub!(/\\log((\{\})|\s|$)/, "log")
+ str.gsub!(/\\max((\{\})|\s|$)/, "max")
+ str.gsub!(/\\min((\{\})|\s|$)/, "min")
+ str.gsub!(/\\Pr((\{\})|\s|$)/, "Pr")
+ str.gsub!(/\\sec((\{\})|\s|$)/, "sec")
+ str.gsub!(/\\sin((\{\})|\s|$)/, "sin")
+ str.gsub!(/\\sinh((\{\})|\s|$)/, "sinh")
+ str.gsub!(/\\sup((\{\})|\s|$)/, "sup")
+ str.gsub!(/\\tan((\{\})|\s|$)/, "tan")
+ str.gsub!(/\\tanh((\{\})|\s|$)/, "tanh")
+ str.gsub!(/\\bull((\{\})|\s|$)/, "")
+ str.gsub!(/\\bullet((\{\})|\s|$)/, "")
+ str.gsub!(/\\star((\{\})|\s|$)/, "")
+ str.gsub!(/\\lowast((\{\})|\s|$)/, "")
+ str.gsub!(/\\ast((\{\})|\s|$)/, "*")
+ str.gsub!(/\\odot((\{\})|\s|$)/, "ʘ")
+ str.gsub!(/\\oplus((\{\})|\s|$)/, "")
+ str.gsub!(/\\otimes((\{\})|\s|$)/, "")
+ str.gsub!(/\\checkmark((\{\})|\s|$)/, "")
+ str.gsub!(/\\para((\{\})|\s|$)/, "")
+ str.gsub!(/\\ordf((\{\})|\s|$)/, "ª")
+ str.gsub!(/\\ordm((\{\})|\s|$)/, "º")
+ str.gsub!(/\\cedil((\{\})|\s|$)/, "¸")
+ str.gsub!(/\\oline((\{\})|\s|$)/, "")
+ str.gsub!(/\\uml((\{\})|\s|$)/, "¨")
+ str.gsub!(/\\zwnj((\{\})|\s|$)/, "")
+ str.gsub!(/\\zwj((\{\})|\s|$)/, "")
+ str.gsub!(/\\lrm((\{\})|\s|$)/, "")
+ str.gsub!(/\\rlm((\{\})|\s|$)/, "")
+ str.gsub!(/\\smile((\{\})|\s|$)/, "")
+ str.gsub!(/\\smiley((\{\})|\s|$)/, "")
+ str.gsub!(/\\blacksmile((\{\})|\s|$)/, "")
+ str.gsub!(/\\sad((\{\})|\s|$)/, "")
+ str.gsub!(/\\clubs((\{\})|\s|$)/, "")
+ str.gsub!(/\\clubsuit((\{\})|\s|$)/, "")
+ str.gsub!(/\\spades((\{\})|\s|$)/, "")
+ str.gsub!(/\\spadesuit((\{\})|\s|$)/, "")
+ str.gsub!(/\\hearts((\{\})|\s|$)/, "")
+ str.gsub!(/\\heartsuit((\{\})|\s|$)/, "")
+ str.gsub!(/\\diams((\{\})|\s|$)/, "")
+ str.gsub!(/\\diamondsuit((\{\})|\s|$)/, "")
+ str.gsub!(/\\Diamond((\{\})|\s|$)/, "")
+ str.gsub!(/\\loz((\{\})|\s|$)/, "")
+ end
+end # module Orgmode
View
37 util/gen-special-replace.el
@@ -0,0 +1,37 @@
+;; This code creates ruby code to replace special symbols with the corresponding utf8/html code
+
+(require 'org-entities)
+
+(defvar gen-use-entities-user t)
+(defvar gen-file-name "replace-entities.rb")
+
+(defun generate-replace-inbuffer (what)
+ (let ((ll (if gen-use-entities-user
+ (append org-entities-user org-entities)
+ org-entities))
+ (to (if (string= what "html") 3
+ 6))) ; use utf8 for textile
+ (insert " def Orgmode.special_symbols_to_" what "(str)\n")
+ (dolist (entity ll)
+ (when (listp entity)
+ (let ((symb (nth to entity)))
+ (when (or (string= symb "\"") (string= symb "\\"))
+ (setq symb (concat "\\" symb)))
+ (insert " str.gsub!(/\\\\" (car entity) "((\\{\\})|\\s|$)/, \"" symb "\")\n"))))
+ (insert " end\n")))
+
+(defun generate-replace (file-name what)
+ (when (file-exists-p file-name)
+ (let ((buf (find-buffer-visiting file-name)))
+ (when buf
+ (kill-buffer buf)))
+ (delete-file file-name))
+ (find-file file-name)
+ (insert "# Autogenerated by util/gen-special-replace.el\n\nmodule Orgmode\n")
+ (generate-replace-inbuffer what)
+ (insert "end # module Orgmode\n")
+ (save-buffer)
+ (kill-buffer))
+
+(generate-replace "../lib/org-ruby/html_symbol_replace.rb" "html")
+(generate-replace "../lib/org-ruby/textile_symbol_replace.rb" "textile")

0 comments on commit 7354b58

Please sign in to comment.