1. Viliam Segeda
  2. semanticeditor


Luke Plant  committed 5636f5e

Remove custom ids when done editing.

  • Participants
  • Parent commits 3396559
  • Branches default

Comments (0)

Files changed (1)

File semanticeditor/utils/presentation.py

View file
     if pretty_print:
+    # Remove the temporary IDs we may have added when splitting the HTML
+    # into content and presentation.  We don't do this before this point,
+    # as the IDs need to be there to identify sections
+    for si in structure:
+        if 'id' in si.node.attrib:
+            del si.node.attrib['id']
     if return_tree:
         return (root, structure, section_nodes)
             if 'class' in si.node.attrib:
                 del si.node.attrib['class']
-        # Add custom ids
+        # Add custom ids.  These are only for purpose of editing,
+        # and will be removed again at end of format_html
         si.node.set('id', si.sect_id)
         # Parent/grandparent of section - newcol/newrow