Skip to content

Commit

Permalink
Use .category to pick admonition color in terminal
Browse files Browse the repository at this point in the history
As per the manual, the styling of the admonition should be determined by
its type/category, a lowecase string stored in the .category field.
  • Loading branch information
mortenpi committed Aug 11, 2019
1 parent d5db35b commit 37a055c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/Markdown/src/render/terminal/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ end
function term(io::IO, md::Admonition, columns)
col = :default
# If the types below are modified, the page manual/documentation.md must be updated accordingly.
if lowercase(md.title) == "danger"
if md.category == "danger"
col = Base.error_color()
elseif lowercase(md.title) == "warning"
elseif md.category == "warning"
col = Base.warn_color()
elseif lowercase(md.title) in ("info", "note")
elseif md.category in ("info", "note")
col = Base.info_color()
elseif lowercase(md.title) == "tip"
elseif md.category == "tip"
col = :green
end
printstyled(io, ' '^margin, ""; color=col, bold=true)
Expand Down

0 comments on commit 37a055c

Please sign in to comment.