-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Loading external StyledString package removes markdown highlighting #91
Comments
Do we have a root cause for this yet? |
I don't, but I have noticed that with StyledStrings as the active project you can see this in a Julia REPL session: help?> thing
# Observe working syntax highlighting
julia> using StyledStrings
help?> thing
# Syntax highlighting breaks
julia> using Markdown
help?> thing
# Syntax highlighting works again Checking julia> Base.loaded_modules_order
22-element Vector{Module}:
Core
Base
Main
FileWatching
Libdl
Artifacts
SHA
Sockets
LinearAlgebra
OpenBLAS_jll
libblastrampoline_jll
Random
Base64
StyledStrings
JuliaSyntaxHighlighting
Markdown
InteractiveUtils
Unicode
REPL
StyledStrings
JuliaSyntaxHighlighting
Markdown
julia> length(unique(Base.loaded_modules_order))
22 |
If I had to guess, StyledStrings has some code that is embedding Face types: StyledStrings.jl/src/styledmarkup.jl Line 725 in da41b6a
but then Line 237 in da41b6a
which runs into an issue almost exactly like the one I accidentally created with TOML recently (JuliaLang/Pkg.jl#4017 (comment)) Basically |
I think I found the issue - The second copy of StyledStrings contains a default "FACES" dictionary (w/o the Markdown faces) and then overrides Base.write(::IO, ::Base.AnnotatedString) so that any old AnnotatedStrings floating about start seeing the "FACES" only from the second loaded copy of StyledStrings. In particular, the AnnotatedString's created by Markdown are suddenly missing their Face definitions. Mis-behavior like this is really easy to get with The part that matters is:
Given that guideline, I think we only have a few options here:
The basic problem is that a type-pirated method must be simultaneously correct for all copies of a stdlib. |
This is when having this package as the active project and loading it.
The text was updated successfully, but these errors were encountered: