@@ -110,8 +110,8 @@ macro styled_str(raw_content::String)
110110
111111 # Instead we'll just use a `NamedTuple`
112112 state = let content = unescape_string (raw_content, (' {' , ' }' , ' :' , ' $' , ' \n ' , ' \r ' ))
113- (; content, bytes = Vector {UInt8} (content),
114- s = Iterators. Stateful (zip ( eachindex (content), content)),
113+ (; content, bytes = Vector {UInt8} (content),
114+ s = Iterators. Stateful (pairs ( content)),
115115 parts = Any[],
116116 active_styles = Vector{Tuple{Int, Int, Union{Symbol, Expr, Pair{Symbol, Any}}}}[],
117117 pending_styles = Tuple{UnitRange{Int}, Union{Symbol, Expr, Pair{Symbol, Any}}}[],
@@ -246,7 +246,8 @@ macro styled_str(raw_content::String)
246246 end
247247 expr, nextpos = Meta. parseatom (state. content, pos)
248248 nchars = length (state. content[pos: prevind (state. content, nextpos)])
249- for _ in 1 : min (length (state. s), nchars)
249+ for _ in 1 : nchars
250+ isempty (state. s) && break
250251 popfirst! (state. s)
251252 end
252253 expr, nextpos
0 commit comments