Skip to content

Commit 6999f0a

Browse files
committed
Fix markdown rendering on dag docs
1 parent 68737b8 commit 6999f0a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export const Header = ({
9494
<DisplayMarkdownButton
9595
header="Dag Documentation"
9696
icon={<FiBookOpen />}
97-
mdContent={dag.doc_md}
97+
mdContent={dag.doc_md
98+
.split("\n")
99+
.map((str) => str.trimStart())
100+
.join("\n")}
98101
text="Dag Docs"
99102
/>
100103
)}

airflow-core/src/airflow/ui/src/pages/Task/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const Header = ({ task }: { readonly task: TaskResponse }) => (
3030
<DisplayMarkdownButton
3131
header="Task Documentation"
3232
icon={<FiBookOpen />}
33-
mdContent={task.doc_md}
33+
mdContent={task.doc_md
34+
.split("\n")
35+
.map((str) => str.trimStart())
36+
.join("\n")}
3437
text="Task Docs"
3538
/>
3639
)

0 commit comments

Comments
 (0)