Ensure changelog render is consistent with all line separator #183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Details
This pull request should fix #182 , and ensures that changelog render is consistent with all line separator.
In this moment,
LF
line separator works properly, but insteadCRLF
andLF
have some bugs/different behaviour.Description
While the purpose of PR #177 was only to fix a regresion, the goal of this PR is to ensures that changelog render is unbiased to line separator.
In particular:
lineSeparator
tomarkdownToHTML
helper methodmarkdownToHTML
andmarkdownToPlainText
now convert line separator toLF
before AST parsing.reformat
method (Some regex work only with\n
or\r
, but not with\r\n
, due to missing group)assertText
method, useful for test that plain text output strings are equals (Without improperly usingassertMarkdown
)processOutput
normalize line separator also forOutputType.MARKDOWN
(In same cases,joinToString
andreformat
is not enough and generate a content that contains different line separators)Related Issue
Motivation and Context
While the purpose of PR #177 was only to fix a regresion, the goal of this PR is to ensures that changelog render is unbiased to line separator. See also #182 to see some cases that this PR fix.
The solution applied is the same of #177, so:
LF
.but this time the behaviour is applied to all code that use the markdown library.
See also markdown bug
How Has This Been Tested
I have added some unit test, that cover my modification. All new and existing tests passed.
Types of changes
Checklist