You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/06/30 04:36:53 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #32042: Render list items in rendered fields view

uranusjr commented on code in PR #32042:
URL: https://github.com/apache/airflow/pull/32042#discussion_r1247417503


##########
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:
   Why `if` instead of `elif` as in the old code?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org