Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing line breaks with <br> in markdown text #7184

Merged

Conversation

janusbal
Copy link
Contributor

@janusbal janusbal commented Apr 4, 2022

Description

Android, web and desktop support \n in markdown texts while iOS does not. This adds support to line breaks by replacing them with
html tag before generating the html string.

Sample Card

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
 
    {
 
      "type": "Container",
 
      "items": [
 
        {
 
          "type": "TextBlock",
 
          "text": "Hello User",
 
          "wrap": true
 
        },
 
        {
 
          "type": "TextBlock",
 
          "text": "**bold**\n\n_cursive_",
 
          "wrap": true
 
        }
 
      ]
 
    }
 
  ]
}

How Verified

How you verified the fix, including one or all of the following:

  1. New unit tests that were added if any. If none were added please add a quick line explaining why not.
  2. Existing relevant unit/regression tests that you ran
  3. Manual scenario verification if any; Do include .gif's or screenshots of the testing you performed here if you think that it
    will aid in code reviews or corresponding fixes on other platforms for eg.
Microsoft Reviewers: Open in CodeFlow

Copy link
Member

@jwoo-msft jwoo-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janusbal

I think you forgot to run clang-format.

other than that, it looks good.

@jwoo-msft jwoo-msft merged commit 983a6d0 into microsoft:main Apr 14, 2022
jwoo-msft pushed a commit that referenced this pull request May 11, 2022
* replacing line breaks with <br>

* addressing PR comment

* clang format

Co-authored-by: Janus Balatbat <[email protected]>
paulcam206 pushed a commit that referenced this pull request May 12, 2022
* Replacing line breaks with <br> in markdown text (#7184)

* replacing line breaks with <br>

* addressing PR comment

* clang format

Co-authored-by: Janus Balatbat <[email protected]>

* fixed vo announcing misspelled words (#7443)

Co-authored-by: janusbal <[email protected]>
Co-authored-by: Janus Balatbat <[email protected]>
michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this pull request Nov 10, 2022
* replacing line breaks with <br>

* addressing PR comment

* clang format

Co-authored-by: Janus Balatbat <[email protected]>
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
* replacing line breaks with <br>

* addressing PR comment

* clang format

Co-authored-by: Janus Balatbat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants