chore: Reduce explicit usage of new lines#338
Conversation
Added a function to detect line endings in content.
|
@thompson-tomo Some new merge conflicts on this, unfortunately. |
|
All fixed. @AndrewSouthpaw & would be good to get your thoughts on #339 which is the successor to this. |
AndrewSouthpaw
left a comment
There was a problem hiding this comment.
Just a couple small nits
|
@AndrewSouthpaw feedback implemented |
|
Checks are failing btw |
|
Sorry about that @AndrewSouthpaw fixed now. |
| // build the expected content | ||
| var pragma = contentGenerator.pragmaMarkers(syntax || 'md'); |
There was a problem hiding this comment.
Hmm I'd rather not build the eol based on the implementation output. It's not exactly tautological (because of a detail in the test assertion), but it's close.
If we want to eventually test eol configs for both \n and \r\n etc., I'd rather create a test matrix or write them out explicitly.
This will also allow us to drop the eol being exposed from transform, which is currently only used by the test.
Thoughts?
There was a problem hiding this comment.
I agree it is not great but couldn't think of a better way as i wanted to avoid adding another argument to the method but will go down that path. Please take another look as I have made the change & have also updated #339
|
@AndrewSouthpaw i think this is good to merge now. |
This uses an array of toc contents which is only combined into a string at the end which reduces the explicit usage of EOL characters and increases readability.