Skip to content

Commit c25992a

Browse files
committed
Fix in-string newline handling and pass whitespace_in_value.ftl
1 parent 110922c commit c25992a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fluent/resource.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ node_types.Pattern = class({
118118
return tablex.reduce(math.min, indents) or 0
119119
end
120120
local striplen = tablex.reduce(math.min, tablex.imap(mindent, self.elements)) or 0
121-
local i, strippref = 1, "\n\n"
121+
local i, strippref = 1, "\n"
122122
while i <= striplen do
123123
strippref = strippref .. " "
124124
i = i + 1
@@ -127,7 +127,7 @@ node_types.Pattern = class({
127127
if type(node.value) == "string" then
128128
local value = string.gsub(node.value, "\r\n", "\n")
129129
if len >= 1 then
130-
value = string.gsub(value, strippref, "\n")
130+
value = string.gsub(value, strippref, "\n\n")
131131
end
132132
value = string.gsub(value, "^[\n ]+", "")
133133
value = string.gsub(value, "[\n ]+$", "")

spec/fixtures_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('upstream reference fixture', function ()
5353
-- or fname:match("/terms.ftl$")
5454
or fname:match("/variables.ftl$")
5555
-- or fname:match("/variant_keys.ftl$")
56-
-- or fname:match("/whitespace_in_value.ftl$")
56+
or fname:match("/whitespace_in_value.ftl$")
5757
or fname:match("/zero_length.ftl$")
5858
) then
5959
describe(object, function ()

0 commit comments

Comments
 (0)