Ticket #771: scaps.patch
| File scaps.patch, 1.6 KB (added by fbennett, 7 years ago) |
|---|
-
chrome/content/zotero/bindings/styled-textbox.xml
161 161 if(this._format == "Integration" || this._format == "RTF") { 162 162 // do appropriate replacement operations 163 163 for(var needle in this._rtfMap) { 164 output = output.replace(needle, this._rtfMap[needle], "g");164 output = output.replace(needle, this._rtfMap[needle], "g"); 165 165 } 166 166 while (output.match(/<span[^>]*small-caps[^>]*>/)){ 167 var l = output.split(/<span[^>]*small-caps[^>]*>/); 168 var m = l[1].match(/<span[^>]*>/g); 169 if (m){ 170 var n = m.length; 171 var x = l[1].split("</span>"); 172 var mymiddle = l[1].slice(0,n).join("</span>"); 173 var myend = l[1].slice(n).join("</span>"); 174 l[1] = mymiddle + "\\scaps0 " + myend; 175 } 176 output = l.join("\\scaps "); 177 } 167 178 output = output.replace("<p>", "", "g"); 168 179 output = output.replace("</p>", "\\par ", "g"); 169 180 output = output.replace(/<\/?div[^>]*>/g, ""); … … 236 247 html = html.replace(this._rtfMap[needle], needle, "g"); 237 248 } 238 249 } 250 html = html.replace("\\scaps ", "<span style=\"font-variant:small-caps\">", "g"); 251 html = html.replace("\\scaps0 ", "</span>", "g"); 239 252 html = '<div style="'+bodyStyle+'"><p>'+html.replace("\par ", "</p><p>")+"</p></div>"; 240 253 Zotero.debug("setting content to "+html); 241 254 }