Closed pomber closed 6 months ago
Repro: https://stackblitz.com/~/edit/stackblitz-starters-9jr2ud
These two strings return different results:
function test(code) { const result = twoslasher(code) console.log("input code", JSON.stringify(code)) console.log("output code", JSON.stringify(result.code)) console.log("hover", result.hovers[0]) } test("const a = 1\n// ---cut---\nconst b = 2") test("const a = 1\r\n// ---cut---\r\nconst b = 2")
input code "const a = 1\n// ---cut---\nconst b = 2" output code "const b = 2" hover { line: 0, ... } input code "const a = 1\r\n// ---cut---\r\nconst b = 2" output code "\nconst b = 2" hover { line: 1, ...}
I think the result should be the same for both cases. If you agree I can send a PR with a test and a fix.
result
Yeah it should be consider a bug - pr would be great, thank you!
Repro: https://stackblitz.com/~/edit/stackblitz-starters-9jr2ud
These two strings return different results:
I think the
result
should be the same for both cases. If you agree I can send a PR with a test and a fix.