From 37a055c09964c014a82b7103dbdee90266bca798 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Sun, 11 Aug 2019 16:18:46 +1200 Subject: [PATCH] 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. --- stdlib/Markdown/src/render/terminal/render.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/Markdown/src/render/terminal/render.jl b/stdlib/Markdown/src/render/terminal/render.jl index 3edc16e62a3bf..010f226a6bcd8 100644 --- a/stdlib/Markdown/src/render/terminal/render.jl +++ b/stdlib/Markdown/src/render/terminal/render.jl @@ -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)