[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2024-02-12 18:25:54 +00:00
parent ae3c36b5dd
commit b467bfe01e
2 changed files with 53 additions and 13 deletions

View File

@@ -28,19 +28,47 @@ GLOBAL_ATTRIBUTES = [
# class and style are different ones that are handled by pydom.element directly
CUSTOM_ATTRIBUTES = {
'a': ['download', 'href', 'referrerpolicy', 'rel', 'target', 'type'],
'td': ['colspan', 'headers', 'rowspan'],
'template': ['shadowrootmode'],
'textarea': ['autocapitalize', 'autocomplete', 'autofocus', 'cols', 'dirname', 'disabled',
'form', 'maxlength', 'minlength', 'name', 'placeholder', 'readonly',
'required', 'rows', 'spellcheck', 'wrap'],
'tr': ['abbr', 'colspan', 'headers', 'rowspan', 'scope'],
'time': ['datetime'],
'video': ['autoplay', 'controls', 'crossorigin', 'disablepictureinpicture',
'disableremoteplayback', 'height', 'loop', 'muted', 'playsinline',
'poster', 'preload', 'src', 'width'],
"a": ["download", "href", "referrerpolicy", "rel", "target", "type"],
"td": ["colspan", "headers", "rowspan"],
"template": ["shadowrootmode"],
"textarea": [
"autocapitalize",
"autocomplete",
"autofocus",
"cols",
"dirname",
"disabled",
"form",
"maxlength",
"minlength",
"name",
"placeholder",
"readonly",
"required",
"rows",
"spellcheck",
"wrap",
],
"tr": ["abbr", "colspan", "headers", "rowspan", "scope"],
"time": ["datetime"],
"video": [
"autoplay",
"controls",
"crossorigin",
"disablepictureinpicture",
"disableremoteplayback",
"height",
"loop",
"muted",
"playsinline",
"poster",
"preload",
"src",
"width",
],
}
class ElementBase(pydom.Element):
tag = "div"
@@ -491,8 +519,19 @@ class iframe(TextElementBase):
# code tags only have the global attributes ones
_add_js_properties(iframe, "allow", "allowfullscreen", "height", "loading", "name",
"referrerpolicy", "sandbox", "src", "srcdoc", "width")
_add_js_properties(
iframe,
"allow",
"allowfullscreen",
"height",
"loading",
"name",
"referrerpolicy",
"sandbox",
"src",
"srcdoc",
"width",
)
class img(ElementBase):

View File

@@ -1,4 +1,5 @@
"""Markdown module to generate web/HTML components from Markdown code"""
from pyscript import document, window
from pyweb import pydom
from pyweb.ui.elements import TextElementBase, script