Skip to content

Commit 37a055c

Browse files
committed
Use .category to pick admonition color in terminal
As per the manual, the styling of the admonition should be determined by its type/category, a lowecase string stored in the .category field.
1 parent d5db35b commit 37a055c

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)