Skip to content

Commit 67c8fdf

Browse files
committed
Add support to replace a macro used inside a string when surrounded with @
1 parent 7fdf342 commit 67c8fdf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/yconf.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,11 @@ replace_macro(V, {Name, Val}, Macros, Path) ->
934934
false -> replace_macros(Val, Macros, [Name|Path])
935935
end;
936936
_ ->
937-
V
937+
case is_binary(V) andalso is_binary(Val) of
938+
true -> re:replace(V, <<"@", Name/binary, "@">>, Val,
939+
[{return, binary}, global]);
940+
false -> V
941+
end
938942
end;
939943
replace_macro(Val, _, _, _) ->
940944
Val.

0 commit comments

Comments
 (0)