Skip to content

Commit 28e3d9e

Browse files
Fix generating quotes
Signed-off-by: David A. Wheeler <[email protected]>
1 parent 9689025 commit 28e3d9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/baseline_i18n_extractor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def generate_yaml_content(i18n_data)
150150
lines << " #{line}"
151151
end
152152
else
153-
# Escape quotes in the value
154-
escaped_value = field_value.gsub('"', '\"')
153+
# Escape backslashes first, then quotes (order matters!)
154+
escaped_value = field_value.gsub('\\', '\\\\').gsub('"', '\\"')
155155
lines << " #{field_name}: \"#{escaped_value}\""
156156
end
157157
end

0 commit comments

Comments
 (0)