Closed AmeliaSZK closed 4 years ago
Update: Embedded newlines in string literals are also removed during formatting (they are preserved during paste), and non-leading consecutive spaces are also removed during paste.
I didn't make a whole new issue because I suspect the fix will be the same for both.
Copied
let
Result =
"[Key] [Name] [Differentiated]
wh2_main_lothern Lothern Lothern
wh2_dlc09_tomb_kings Tomb Kings Tomb Kings
wh2_dlc09_tomb_kings_qb1 Tomb Kings Tomb Kings (Qb1)
wh2_dlc09_tomb_kings_qb2 Tomb Kings Tomb Kings (Qb2)"
in
Result
Pasted
let
Result =
"[Key] [Name] [Differentiated]
wh2_main_lothern Lothern Lothern
wh2_dlc09_tomb_kings Tomb Kings Tomb Kings
wh2_dlc09_tomb_kings_qb1 Tomb Kings Tomb Kings (Qb1)
wh2_dlc09_tomb_kings_qb2 Tomb Kings Tomb Kings (Qb2)"
in
Result
Formatted
let
Result
= "[Key] [Name] [Differentiated] wh2_main_lothern Lothern Lothern wh2_dlc09_tomb_kings Tomb Kings Tomb Kings wh2_dlc09_tomb_kings_qb1 Tomb Kings Tomb Kings (Qb1) wh2_dlc09_tomb_kings_qb2 Tomb Kings Tomb Kings (Qb2)"
in
Result
Expected behavior
Not sure what I should be expecting from a formatter beyond "don't alter string literals" in such an edge case. The funky formatting in the literal is because it's meant to be used in the Result
field of a Documentation.Examples record.
Thanks again for this report. I just deployed the fix.
Description In the web formatter, when pasting code to format, string literals with leading spaces (plural) are altered to leave only 1 leading space.
Power Query- / M-Code Copied:
Pasted:
Formatted:
Expected behavior String literals should never be altered by a code formatter. (Btw, I really like how you put the
&
in front of the line instead of at the end 👀)Settings All defaults.