-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easier way to prevent markdown parsing? #48
Comments
For now I just defined struct RawStr
x::String
end
Base.show(io::IO, m::MIME"text/plain", s::RawStr) = show(io, m, s.x) and I can do |
There should really be a way to disable this IMHO as it breaks any multiline messages, making it unsuitable as a drop-in default logger or in combination with other loggers that don't do markdown |
I just had exactly the same problem. The fact that log messages are interpreted as Markdown by default surprised me, especially since if I actually wanted that I could just do: using Markdown
@info md"Some _emphasized_ text." Output: Some emphasized text. Regarding the specific issue of interpolating paths: I usually quote values inside text output, especially if they are text themselves, e.g. in single quotes to signify which part of the message is variable. For @info "Some `path_with_underscores`." Output: Some This is not perfect because In my opinion, Markdown formatting should be opt-in. |
I’m logging an interpolated string, but underlines in the path are being interpreted as markdown by the logging:
(you can’t see it, but
path
is underlined in thesomepathfoo
in the REPL).My first idea was to add escapes to the
_
:This isn't super great because folks who are using the default
ConsoleLogger
will see the extra escape characters.The other option would be to define a custom type that's not an
AbstractString
and defines the rightshow
method, but this also seems clunky.Is there an easier way to prevent markdown parsing?
The text was updated successfully, but these errors were encountered: