File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1515class CssOptions :
1616 is_global : bool
1717 scope_id : str
18- lang : str | None
18+ lang : t . Optional [ str ]
1919
2020
2121class ExtractResult (t .NamedTuple ):
2222 html : str
2323 css : str
2424
2525
26- def extract_css_from_html (body : str , prefix : str | None = None ) -> ExtractResult :
26+ def extract_css_from_html (body : str , prefix : t . Optional [ str ] = None ) -> ExtractResult :
2727 soup = HtmlSoup (body )
2828 css = ""
2929
@@ -65,7 +65,7 @@ def transform_styles(css: str, options: CssOptions) -> str:
6565 return css
6666
6767
68- def get_bs4_attr (tag : bs4 .Tag , attr : str ) -> str | None :
68+ def get_bs4_attr (tag : bs4 .Tag , attr : str ) -> t . Optional [ str ] :
6969 value = tag .get (attr , None )
7070 if isinstance (value , list ):
7171 value = value [0 ]
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def generate_scope_id(prefix: t.Union[str, None]) -> str:
6262 return f"{ prefix } -{ hash [:6 ]} "
6363
6464
65- def apply_scope_to_soup (soup : bs4 .BeautifulSoup , scope_id : str | None ):
65+ def apply_scope_to_soup (soup : bs4 .BeautifulSoup , scope_id : t . Union [ str , None ] ):
6666 for tag in soup .find_all ():
6767 if is_tag_in_head (tag ):
6868 continue
You can’t perform that action at this time.
0 commit comments