Skip to content

Commit 8985a37

Browse files
committed
Fix interpolation edge case dropping annotations
It is possible to have types with annotations that should be preserved other than AnnotatedString (such as SubString{AnnotatedString}), and so we should consult with Base._isannotated instead of just checking if the type is an AnnotatedString specifically.
1 parent 729f56c commit 8985a37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/styledmarkup.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function addpart!(state::State, start::Int, expr, stop::Int)
260260
push!(state.parts,
261261
:(let $str = string($expr)
262262
$len = ncodeunits($str) # Used in `annots`.
263-
if $str isa AnnotatedString && !isempty($str)
263+
if Base._isannotated($str) && !isempty($str)
264264
AnnotatedString(String($str), vcat($annots, annotations($str)))
265265
else
266266
if isempty($str)

0 commit comments

Comments
 (0)