From e638190ca99da8ad43466aaef34a9a497272d7a1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Dec 2009 10:21:19 +0000 Subject: [PATCH] Fixes #771, small caps and editor Patch from Frank (with a few stylistic tweaks) to preserve small caps in citation editor -- since we now use TinyMCE rather than Midas, we could actually include a button for small caps, but this is probably sufficient --- .../zotero/bindings/styled-textbox.xml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index d7732ca8dc..ab98b934f4 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -164,6 +164,28 @@ output = output.replace(needle, this._rtfMap[needle], "g"); } + // Preserve small caps + var l = output.split(/(<\/?span[^>]*>)/); + var current_level = 0; + var tag_level = []; + for (var pos=1; pos", "", "g"); output = output.replace("

", "\\par ", "g"); output = output.replace(/<\/?div[^>]*>/g, ""); @@ -236,6 +258,10 @@ html = html.replace(this._rtfMap[needle], needle, "g"); } } + + html = html.replace("\\scaps ", "", "g"); + html = html.replace("\\scaps0 ", "", "g"); + html = '

'+html.replace("\par ", "

")+"

"; Zotero.debug("setting content to "+html); }