Markdown/Code block compatible output #358
Merged
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.
The current output, while very readable, isn't compatible with syntax highlighting in markdown code blocks. Generally the code block output, is a special kind of human readable output, which needs to the very strict syntaxes of the highlighting library used.
What seems to be common is the requirement that the modifier, to highlight the line, needs to be at the beginning of the line without indentation, and only a full line can be highlighted (not single letters)
This pull requests implements a
diff
syntax highlighting compatible output, based on theHumanReport
, with removed indentations, and a different prefix for paths, RootDescriptions and changeTypes (to avoid highlighting the introduction line for additiona & removal).Additionally since only full lines can be coloured, the table style is disabled and multiline (as well as binary and certificate) changes, are prefixed continuously.
Using configurable prefixes, it's possible to easily support the Markdown code block on GitHub, GitLab, and Gitea/Forgejo, while ensuring it's easy to add support for further highlighting libraries (eg. for Bitbucket)
Fixes #325