diff --git a/src/stylemacro.jl b/src/stylemacro.jl index b0305690..bbae63c6 100644 --- a/src/stylemacro.jl +++ b/src/stylemacro.jl @@ -105,8 +105,12 @@ macro styled_str(raw_content::String) interpolated::Ref{Bool} # whether any string interpolation occurs errors::Vector # any errors raised during parsing end =# - # Instead we'll just use a `NamedTuple` + + # first undo the transforms of the parser (assuming the input was entered with single styled"" markers so this transform is unambiguously reversible and not as `@styled_str "."` or `styled"""."""`), + # since the `unescape_string` transforms will be a superset of those transforms + raw_content = Base.escape_raw_string(raw_content) + state = let content = unescape_string(raw_content, ('{', '}', '$', '\n', '\r')) (; content, bytes = Vector{UInt8}(content), s = Iterators.Stateful(pairs(content)),