瀏覽代碼

code review

Falko Schindler 1 年之前
父節點
當前提交
4470c7807b
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      nicegui/elements/html.py
  2. 1 1
      website/documentation/content/html_documentation.py

+ 2 - 2
nicegui/elements/html.py

@@ -3,7 +3,7 @@ from .mixins.content_element import ContentElement
 
 
 class Html(ContentElement):
 class Html(ContentElement):
 
 
-    def __init__(self, content: str = '', tag: str = "div" ) -> None:
+    def __init__(self, content: str = '', *, tag: str = 'div') -> None:
         """HTML Element
         """HTML Element
 
 
         Renders arbitrary HTML onto the page, wrapped in the specified tag. 
         Renders arbitrary HTML onto the page, wrapped in the specified tag. 
@@ -12,6 +12,6 @@ class Html(ContentElement):
         to add it into the body.
         to add it into the body.
 
 
         :param content: the HTML code to be displayed
         :param content: the HTML code to be displayed
-        :param tag: the HTML tag to wrap the content in (default: div)
+        :param tag: the HTML tag to wrap the content in (default: "div")
         """
         """
         super().__init__(tag=tag, content=content)
         super().__init__(tag=tag, content=content)

+ 1 - 1
website/documentation/content/html_documentation.py

@@ -12,7 +12,7 @@ def main_demo() -> None:
     Use the `tag` parameter to produce something other than a div.
     Use the `tag` parameter to produce something other than a div.
 ''')
 ''')
 def demo_inline() -> None:
 def demo_inline() -> None:
-    ui.html('This is rendered as a paragraph.', tag='p')
+    ui.html('This is <u>emphasized</u>.', tag='em')
 
 
 
 
 doc.reference(ui.html)
 doc.reference(ui.html)