Skip to content

Commit 6527de0

Browse files
Use .category to pick admonition color in terminal (#32865)
As per the manual, the styling of the admonition should be determined by its type/category, a lowecase string stored in the .category field.
2 parents 09fa250 + 37a055c commit 6527de0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/Markdown/src/render/terminal/render.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ end
3434
function term(io::IO, md::Admonition, columns)
3535
col = :default
3636
# If the types below are modified, the page manual/documentation.md must be updated accordingly.
37-
if lowercase(md.title) == "danger"
37+
if md.category == "danger"
3838
col = Base.error_color()
39-
elseif lowercase(md.title) == "warning"
39+
elseif md.category == "warning"
4040
col = Base.warn_color()
41-
elseif lowercase(md.title) in ("info", "note")
41+
elseif md.category in ("info", "note")
4242
col = Base.info_color()
43-
elseif lowercase(md.title) == "tip"
43+
elseif md.category == "tip"
4444
col = :green
4545
end
4646
printstyled(io, ' '^margin, ""; color=col, bold=true)

0 commit comments

Comments
 (0)