Ticket #1712: citeproc-1.0.52.patch
| File citeproc-1.0.52.patch, 2.6 KB (added by fbennett, 6 years ago) |
|---|
-
chrome/content/zotero/bindings/styled-textbox.xml
old new 52 52 this._rtfMap = { 53 53 "\\":"\\\\", 54 54 "<em>":"\\i ", 55 "</em>":"\\i0 ",55 "</em>":"\\i0{}", 56 56 "<i>":"\\i ", 57 "</i>":"\\i0 ",57 "</i>":"\\i0{}", 58 58 "<strong>":"\\b ", 59 "</strong>":"\\b0 ",59 "</strong>":"\\b0{}", 60 60 "<b>":"\\b ", 61 "</b>":"\\b0 ",61 "</b>":"\\b0{}", 62 62 "<br />":"\x0B", 63 63 // there's no way to mimic a tab stop in CSS without 64 64 // tables, which wouldn't work here. 65 '<span class="tab"> </span>':"\\tab "65 '<span class="tab"> </span>':"\\tab{}" 66 66 }; 67 67 68 68 this._rtfToHtmlMap = [ 69 [/\\uc0\{?\\u([0-9]+)\}? ?/g, function(wholeStr, aCode) { return String.fromCharCode(aCode) }],70 ["\\t ", '<span class="tab"> </span>'],71 [/(?:\\par |\\\r?\n)/g, "</p><p>"],72 [/\\super (.*?)\\nosupersub /g, "<sup>$1</sup>"],73 [/\\sub (.*?)\\nosupersub /g, "<sub>$1</sub>"]69 [/\\uc0\{?\\u([0-9]+)\}?(?:{}| )?/g, function(wholeStr, aCode) { return String.fromCharCode(aCode) }], 70 ["\\tab{}", '<span class="tab"> </span>'], 71 [/(?:\\par{}|\\\r?\n)/g, "</p><p>"], 72 [/\\super (.*?)\\nosupersub{}/g, "<sup>$1</sup>"], 73 [/\\sub (.*?)\\nosupersub{}/g, "<sub>$1</sub>"] 74 74 ]; 75 75 76 76 this._htmlToRtfMap = [ 77 77 [/"(\w)/, "“$1"], 78 78 [/([\w,.?!])"/, "$1”"], 79 79 ["<p>", ""], 80 ["</p>", "\\par "],80 ["</p>", "\\par{}"], 81 81 [/<\/?div[^>]*>/g, ""], 82 82 ["<sup>", "\\super "], 83 ["</sup>", "\\nosupersub "],83 ["</sup>", "\\nosupersub{}"], 84 84 ["<sub>", "\\sub "], 85 ["</sub>", "\\nosupersub "]85 ["</sub>", "\\nosupersub{}"] 86 86 ]; 87 87 88 88 this._rtfRexMap = [ 89 89 ["<span style=\"font-variant:small-caps;\">", 90 90 /small-caps/, 91 91 "\\scaps ", 92 "\\scaps0 "92 "\\scaps0{}" 93 93 ], 94 94 ["<span style=\"text-decoration:underline;\">", 95 95 /underline/, 96 96 "\\ul ", 97 "\\ul0 "97 "\\ul0{}" 98 98 ] 99 99 ] 100 100 … … 217 217 output = Zotero.Utilities.prototype.unescapeHTML( 218 218 output.replace(" ", " ", "g")) 219 219 .replace(highcharRe, 220 function(aChar) { return "\\uc0\\u"+aChar.charCodeAt(0).toString()+" " });220 function(aChar) { return "\\uc0\\u"+aChar.charCodeAt(0).toString()+"{}" }); 221 221 222 if(output.substr(-4) == "\\par ") output = output.substr(0, output.length-4);222 if(output.substr(-4) == "\\par{}") output = output.substr(0, output.length-4); 223 223 } 224 224 225 225 return output;