Skip to content

Commit d080103

Browse files
committed
Improve type stability within styled"" macro
This way, when interpolating, the type of the expression can be inferred as an AnnotatedString, rather than a Union{String, AnnotatedString}.
1 parent 448314b commit d080103

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/styledmarkup.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function addpart!(state::State, start::Int, expr, stop::Int)
263263
AnnotatedString(String($str), vcat($annots, annotations($str)))
264264
else
265265
if isempty($str)
266-
""
266+
AnnotatedString("")
267267
else
268268
AnnotatedString($str, $annots)
269269
end

0 commit comments

Comments
 (0)