Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix: fix DAG doc display (especially for TaskFlow DAGs) #14564

Merged
merged 3 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions airflow/www/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def wrapped_markdown(s, css_class=None):
if s is None:
return None

s = '\n'.join(line.lstrip() for line in s.split('\n'))

return Markup(f'<div class="{css_class}" >' + markdown.markdown(s, extensions=['tables']) + "</div>")


Expand Down
11 changes: 11 additions & 0 deletions tests/www/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,14 @@ def test_wrapped_markdown_with_table(self):
'</td>\n<td>14m</td>\n</tr>\n</tbody>\n'
'</table></div>'
) == rendered

def test_wrapped_markdown_with_indented_lines(self):
rendered = wrapped_markdown(
"""
# header
1st line
2nd line
"""
)

assert '<div class="None" ><h1>header</h1>\n<p>1st line\n2nd line</p></div>' == rendered