Add option to export annotations in markdown #6141
Closed
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.
Closes #6111
This PR adds a new annotations export format, Markdown.
Some decisions
I initially considered using the HTML format and parsing it to Markdown for simplicity, but it presented some problems:
I looked for other options, but none of them seemed great.
This made me decide to manually render the markdown instead, as we do with other formats.
As mentioned above, and in order to have something closer to the text format, I decided to use bullet points for the summary and annotations info, as opposed to tables as we do in HTML.
Since annotations text contains markdown, I decided to keep it like that, as it is consistent with the export format. However, I wrapped in a
pre
, as a way to "escape" it and avoid breaking the overall format.Quotes are wrapped in a
blockquote
, but trimming every line, otherwise their meaning changes and can potentially render differently depending on where the markdown is used.For example, GitHub interprets extra indentation as a
pre
block.Testing steps
Markdown
from the format dropdown.md
extension containing the markdown.GitHub
issue and click "Preview" -> It should properly render everything.Todo
MD
asMarkdown
does not fit the size of the dropdown, but maybe we want to increase that size instead.