CommunityToolkit/WindowsCommunityToolkit

Markdown parser: incorrect parsing of inline italics

Open

#3,549 opened on Oct 29, 2020

View on GitHub
 (2 comments) (0 reactions) (0 assignees)C# (1,403 forks)batch import
bug :bug:help wantedmarkdown 📑

Repository metrics

Stars
 (5,708 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Describe the bug

Underscore characters placed inside a word without spaces around them (e.g. x_y_z) are treated as opening/closing an italic span. This does not appear consistent with the commonmark standard.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

  • Can this be reproduced in the Sample App?
  1. Open sample app
  2. Open MarkDownTextBlock sample
  3. Add the following markdown to the textbox at the top:
x_y_z

Expected behavior

The underscores should be rendered. None of the text should be italicised.

Actual behaviour

The underscores are not rendered, and the 'y' character is italicised.

Environment

NuGet Package(s): 7.0.0-preview3

Package Version(s): 7.0.0-preview3

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: ) 
- [ ] 2019 Preview (version: )

Contributor guide