Skip to content

Commit

Permalink
Use .category to pick admonition color in terminal (#32865)
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
StefanKarpinski authored Aug 12, 2019
2 parents 09fa250 + 37a055c commit 6527de0
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

2 comments on commit 6527de0

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.