]> git.lyx.org Git - features.git/commitdiff
revert_tabularvalign: fix removal of tabularvalign feature tag
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 27 Dec 2015 16:34:01 +0000 (17:34 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 27 Dec 2015 16:34:01 +0000 (17:34 +0100)
lib/lyx2lyx/lyx_2_0.py

index 6db4d21f274654136af410cd31fe17551a1c25d4..3e6740db1dedb9203a8cdeab1aa223866583f579 100644 (file)
@@ -89,10 +89,7 @@ def revert_tabularvalign(document):
       if p != -1:
           q = document.body[fline].find("tabularvalignment")
           if q != -1:
-              # FIXME
-              # This seems wrong: It removes everything after 
-              # tabularvalignment, too.
-              document.body[fline] = document.body[fline][:q - 1] + '>'
+              document.body[fline] = re.sub(r' tabularvalignment=\"[a-z]+\"', "", document.body[fline])
           i += 1
           continue
 
@@ -108,10 +105,7 @@ def revert_tabularvalign(document):
       # delete tabularvalignment
       q = document.body[fline].find("tabularvalignment")
       if q != -1:
-          # FIXME
-          # This seems wrong: It removes everything after 
-          # tabularvalignment, too.
-          document.body[fline] = document.body[fline][:q - 1] + '>'
+          document.body[fline] = re.sub(r' tabularvalignment=\"[a-z]+\"', "", document.body[fline])
 
       # don't add a box when centered
       if tabularvalignment == 'c':