cvaliente commented on code in PR #32042:
URL: https://github.com/apache/airflow/pull/32042#discussion_r1247431541
##########
airflow/www/utils.py:
##########
@@ -546,20 +547,35 @@ def pygment_html_render(s, lexer=lexers.TextLexer):
return highlight(s, lexer(), HtmlFormatter(linenos=True))
-def render(obj, lexer):
+def render(obj: Any, lexer: Lexer, handler: Optional[Callable[[Any], str]] =
None):
"""Render a given Python object with a given Pygments lexer."""
- out = ""
+
if isinstance(obj, str):
- out = Markup(pygment_html_render(obj, lexer))
- elif isinstance(obj, (tuple, list)):
+ return Markup(pygment_html_render(obj, lexer))
+
+ if isinstance(obj, (tuple, list)):
+ out = ""
for i, text_to_render in enumerate(obj):
+ if lexer == lexers.PythonLexer:
Review Comment:
fixed, thanks :)
##########
airflow/www/utils.py:
##########
@@ -546,20 +547,35 @@ def pygment_html_render(s, lexer=lexers.TextLexer):
return highlight(s, lexer(), HtmlFormatter(linenos=True))
-def render(obj, lexer):
+def render(obj: Any, lexer: Lexer, handler: Optional[Callable[[Any], str]] =
None):
"""Render a given Python object with a given Pygments lexer."""
- out = ""
+
if isinstance(obj, str):
- out = Markup(pygment_html_render(obj, lexer))
- elif isinstance(obj, (tuple, list)):
+ return Markup(pygment_html_render(obj, lexer))
+
+ if isinstance(obj, (tuple, list)):
Review Comment:
fixed, thanks :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]