Skip to content

Commit e1cc9ff

Browse files
author
Daniel Stone
committed
Hopefully fixed bug with compiler inserting extraneous newline if string starts with a variable
1 parent e96580f commit e1cc9ff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

LocalizationCompiler/Ids.Parsers.XliffGenerator/HtmlCompiler.fs

+7-1
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,11 @@ module Generators =
109109
let rest = Text.NormalizeNewlines(contents).Substring(int32(endPosition.Index))
110110
match x with
111111
| [] -> rest
112-
| x -> (x |> Seq.map(fun (leader, tag) -> (leader, generateIdTag(tag))) |> Seq.map (fun (leader, tag) -> leader + (getTranslation matches tag)) |> Seq.reduce (+)) + rest
112+
| x -> (x
113+
|> Seq.map(fun (leader, tag) -> (leader, generateIdTag(tag)))
114+
// DS: The Trim() is there because the xml generator puts a variable on a new line
115+
// if the string starts with a variable, which messes up js formatting because
116+
// js strings can only be on one line.
117+
|> Seq.map (fun (leader, tag) -> leader + (getTranslation matches tag).Trim())
118+
|> Seq.reduce (+)) + rest
113119
| Failure (reasons, state, _) -> reasons

0 commit comments

Comments
 (0)