Skip to content

[Android] Fix Markdown ordered lists to honour start - #6310

Merged
almedina-ms merged 9 commits into
mainfrom
user/almedina-ms/Android_FixMDolNumbering
Sep 13, 2021
Merged

[Android] Fix Markdown ordered lists to honour start#6310
almedina-ms merged 9 commits into
mainfrom
user/almedina-ms/Android_FixMDolNumbering

Conversation

@almedina-ms

@almedina-ms almedina-ms commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

Related Issue

Fixes #6238

Description

Context: In the Android rendered all texts to be rendered are preprocessed to convert the markdown components to HTML

In the android renderer, any text containing ". " is parsed as the start of an ordered markdown list, this approach works most of the time but due to some limitations the ordered lists would always start at 1 as we would miss context on the html tag attributes, for this reason this PR overrides the ContentHandler class behaviour inside of the currently used XMLReader to retrieve the attributes for any given html element and thus providing a correct starting number for any ordered list.

Sample Card

v1.5/Test/TextBlock.Markdown.NumberStart.json

How Verified

  1. A unit test was added to verify the rendered TextBlocks include the right number
Microsoft Reviewers: Open in CodeFlow

Comment thread samples/v1.5/Test/TextBlock.Markdown.NumberStart.json
@ghost ghost removed the Needs: Author Feedback label Sep 3, 2021
@ghost ghost removed the Needs: Author Feedback label Sep 13, 2021
@almedina-ms
almedina-ms merged commit da84677 into main Sep 13, 2021
@almedina-ms
almedina-ms deleted the user/almedina-ms/Android_FixMDolNumbering branch September 13, 2021 21:57
michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this pull request Nov 10, 2022
* Working version with reflection

* Add ContentHandler overrides and add tests

* Fix handled code

* Fix test break

* Add more tests
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
* Working version with reflection

* Add ContentHandler overrides and add tests

* Fix handled code

* Fix test break

* Add more tests
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.

[Rendering] Numbered item in TextBlock always displaying number 1

3 participants