]> git.lyx.org Git - features.git/commitdiff
Simplify storage of html_latex_* info.
authorRichard Heck <rgheck@comcast.net>
Mon, 24 May 2010 19:34:43 +0000 (19:34 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 24 May 2010 19:34:43 +0000 (19:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34491 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/lyx2lyx/lyx_2_0.py
src/Buffer.cpp
src/BufferParams.cpp

index 6687c54087b01bf9e5771b3f6c249591a0444c06..9bd34626aad57b2746abbf9812f60c1830a0cf5f 100644 (file)
@@ -7,6 +7,9 @@ The good example would be 2010-01-10 entry.
 
 -----------------------
 
+2010-05-24 Richard Heck <rgheck@comcast.net>
+  * Format incremented to 389: remove quotes from html_latex_* params.
+
 2010-05-18 Uwe Stöhr <uwestoehr@web.de>
        * Format incremented to 388: support for page sizes A0-3, A6, B0-3, B6
          and JIS B0-6
index 5a124b3d716ca107399fb2408c7ae41540d0181f..bf62cbf599b3e8dd7cbd41ad686d862dc7b73858 100644 (file)
@@ -1540,6 +1540,43 @@ def revert_pagesizes(document):
       del document.header[i]
 
 
+def convert_html_quotes(document):
+  " Remove quotes around html_latex_start and html_latex_end "
+
+  i = find_token(document.header, '\\html_latex_start', 0)
+  if i != -1:
+    line = document.header[i]
+    l = re.compile(r'\\html_latex_start\s+"(.*)"')
+    m = l.match(line)
+    if m != None:
+      document.header[i] = "\\html_latex_start " + m.group(1)
+      
+  i = find_token(document.header, '\\html_latex_end', 0)
+  if i != -1:
+    line = document.header[i]
+    l = re.compile(r'\\html_latex_end\s+"(.*)"')
+    m = l.match(line)
+    if m != None:
+      document.header[i] = "\\html_latex_end " + m.group(1)
+      
+
+def revert_html_quotes(document):
+  " Remove quotes around html_latex_start and html_latex_end "
+  
+  i = find_token(document.header, '\\html_latex_start', 0)
+  if i != -1:
+    line = document.header[i]
+    l = re.compile(r'\\html_latex_start\s+(.*)')
+    m = l.match(line)
+    document.header[i] = "\\html_latex_start \"" + m.group(1) + "\""
+      
+  i = find_token(document.header, '\\html_latex_end', 0)
+  if i != -1:
+    line = document.header[i]
+    l = re.compile(r'\\html_latex_end\s+(.*)')
+    m = l.match(line)
+    document.header[i] = "\\html_latex_end \"" + m.group(1) + "\""
+
 ##
 # Conversion hub
 #
@@ -1588,9 +1625,11 @@ convert = [[346, []],
            [386, []],
            [387, []],
            [388, []],
-                                       ]
+           [389, [convert_html_quotes]]
+          ]
 
-revert =  [[387, [revert_pagesizes]],
+revert =  [[388, [revert_html_quotes]],
+           [387, [revert_pagesizes]],
            [386, [revert_math_scale]],
            [385, [revert_lyx_version]],
            [384, [revert_shadedboxcolor]],
index 96a990e32da70377fa884874bf5a070b602fc2cc..b80a69407a0aa7e28058f014e5bca6b21eeb078f 100644 (file)
@@ -126,7 +126,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 388; // uwestoehr: support for more page sizes
+int const LYX_FORMAT = 389; // rgh: change how html_latex_* is stored
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
index 920b6566d7bbd1753447c1693be175af0ef4bd54..f809ba4dcd511cd649b3f555d7f86df3a9aafd53 100644 (file)
@@ -831,9 +831,11 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\html_math_img_scale") {
                lex >> html_math_img_scale;
        } else if (token == "\\html_latex_start") {
-               lex >> html_latex_start;
+               lex.eatLine();
+               html_latex_start = lex.getString();
        } else if (token == "\\html_latex_end") {
-               lex >> html_latex_end;
+               lex.eatLine();
+               html_latex_end = lex.getString();
        } else {
                lyxerr << "BufferParams::readToken(): Unknown token: " << 
                        token << endl;
@@ -1056,8 +1058,8 @@ void BufferParams::writeFile(ostream & os) const
                 << "\\html_math_output " << html_math_output << '\n'
                 << "\\html_be_strict " << convert<string>(html_be_strict) << '\n'
                 << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n'
-                << "\\html_latex_start \"" << html_latex_start << "\"\n"
-                << "\\html_latex_end \"" << html_latex_end << "\"\n";
+                << "\\html_latex_start " << html_latex_start << "\n"
+                << "\\html_latex_end " << html_latex_end << "\n";
 
        os << pimpl_->authorlist;
 }