microsoft / microsoft/AdaptiveCards

Markdown text inconsistencies

Open
#1,984 2 comments 0 reactions 1 assignee View on GitHub

@paulcam206 is already working on this.

Since May 3, 2019.

Area-Inconsistency Area-Renderers Task
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...

image

As seen with UWP renderer...

image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.