Closed stroborobo closed 2 years ago
Hey @cartermp, since you didn't say anything I implemented my earlier suggestion with the bool ref instead. My assumption was not correct in the original implementation anyways, so it didn't really work well, test was flawed also :/
But this seems to work, at least for the fixed up test and my use case of glueing together different parts of fsharp.github.io/fsharp-core-docs
Weird that this failure is only on Windows: Drops whitespace outside pre
Oh right, the formatter inserts Environment.NewLine, totally forgot about it. I'll change the test to expect those as well.
At the same time the assumption that the code element is formatted is not correct. They are often used at the same time though and with that comes another issue: keeping FormattedMode in elements nested into pre.
I'm not sure how to approach this, I've never worked with refs like here before. Would it be ok to drop the FormattedMode and add an IsFormatted: bool ref instead? And update that when entering/exiting pre elements.