microsoft / microsoft/AdaptiveCards
Markdown text inconsistencies
@paulcam206 is already working on this.
Since May 3, 2019.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
There are numerous consistency issues between the JavaScript renderer and other renderers regarding Markdown-based content (like ignoring/preserving spaces, HTML entities, etc)
- Whitespace preservation
- HTML entities
- Newline preservation
- The fact that web visualizer supports things like headers and other markdown features
Repro payload
Repro payload
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Dogs <\nCats\n\n# New paragraph"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
As seen on web Visualizer...

As seen with UWP renderer...

Ignoring/preserving spaces
The JavaScript renderer doesn't preserve whitespace within TextBlock text. Other renderers, like UWP, do. This is a consistency issue, and also blocks proposals like #1078 working for monospace blocks (since those need whitespace preserved).
However, note that according to Markdown specs it seems like whitespace should be trimmed.
HTML entities
We should have consistent behavior here. Looking at CommonMark's specification of Markdown, HTML entities should be understood and processed by Markdown. Considering we are supporting markdown in our text blocks, we should be doing this?
Newline behavior
According to Markdown specs, a single new line should be trimmed and treated as a single whitespace character (thus not creating a new line). 2 or more new lines should be treated as the start of a new paragraph.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.