changeset 2595:43f68139d90e

fix html validation errors when TOC level is specified
author RogerHaase <haaserd@gmail.com>
date Sat, 03 May 2014 12:45:32 -0700
parents b980a2ecba15
children 611d8ab8063a
files MoinMoin/converter/html_out.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/html_out.py	Wed Apr 16 12:41:10 2014 -0700
+++ b/MoinMoin/converter/html_out.py	Sat May 03 12:45:32 2014 -0700
@@ -739,7 +739,11 @@
         return elem_ref
 
     def visit_moinpage_table_of_content(self, elem):
-        level = int(elem.get(moin_page.outline_level, 6))
+        try:
+            level = int(elem.get(moin_page.outline_level))
+            del elem.attrib[moin_page.outline_level]
+        except TypeError:
+            level = 6
 
         attribs = elem.attrib.copy()
         attribs[html.class_] = 'moin-table-of-contents'