Commits

Kevin Horn committed 24d02f0

* add support for h4 tags (thanks to Koblaid)

Comments (0)

Files changed (1)

lore2sphinx/__init__.py

         uline_text = underline(remove_newlines(title_text), '~')
         return ''.join((BL, uline_text, NL, n2es(elem.tail)))
 
+    def format_h4(self, elem, contents):
+        '''Format a <h4> tag.
+        
+        ..note:: The Lore "specification" does not address h4 tags, 
+                 but Lore itself supports it and h4 tags are used by 
+                 some Lore users, so we support it.
+        '''
+        title_text = ''.join((n2es(elem.text), contents)).strip()
+        uline_text = underline(remove_newlines(title_text), '^')
+        return ''.join((BL, uline_text, NL, n2es(elem.tail)))
+
     def format_br(self, elem, contents):
         '''Format a <br> tag.'''
         return NL + n2es(elem.tail)