Repository: Knio/dominate (language: python)

Issue:
<sup> rendered with linebreak
sup tag doesn't specify inline so line breaks (and therefore whitespace) gets added
Same as #139 
PR to follow

Thanks for this awesome package!
<sup> rendered with linebreak
sup tag doesn't specify inline so line breaks (and therefore whitespace) gets added
Same as #139 
PR to follow

Thanks for this awesome package!


Discussion / hints:

Fix patch:
diff --git a/dominate/tags.py b/dominate/tags.py
index 1b1a044..4d80929 100644
--- a/dominate/tags.py
+++ b/dominate/tags.py
@@ -589,6 +589,7 @@ class sub(html_tag):
 
 
 class sup(html_tag):
+  is_inline = True
   '''
   The sup element represents a superscript.
   '''


Test patch:
diff --git a/tests/test_html.py b/tests/test_html.py
index 50ecf8b..fdab1f5 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -329,6 +329,9 @@ def test_pretty():
 
   assert p('goodbye ', i('cruel'), ' world').render() == \
     '''<p>goodbye <i>cruel</i> world</p>'''
+  
+  assert p('my 1', sup('st'), ' PR').render() == \
+    '''<p>my 1<sup>st</sup> PR</p>'''
 
 
 def test_xhtml():