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

Fixing numbered lists always starting from 1 #6473

Merged
merged 5 commits into from
Jul 8, 2022

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Jul 5, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Includes the html tag start position when parsing html Lists.

  • Copies the original ListHandler and takes into account the initial starting value.
  • Providing our own list tag handler overrides the default

Motivation and context

To fix the confusing behaviour of numbered lists losing their initial value #4777

Screenshots / GIFs

Before After
Screenshot_20220705_143148 Screenshot_20220705_142811

Tests

  • From Element web, send a message starting with #. eg 5. July
  • Notice the 5 has been converted to a 1

Tested devices

  • Physical
  • Emulator
  • OS version(s): 28

@opusforlife2
Copy link
Contributor

OHGODTHANKYOU

@ouchadam ouchadam requested review from a team and fedrunov and removed request for a team July 5, 2022 15:12
@ouchadam
Copy link
Contributor Author

ouchadam commented Jul 5, 2022

have also created a fix upstream noties/Markwon#409

final SpanFactory spanFactory = configuration.spansFactory().get(ListItem.class);

// Modified line
int number = Integer.parseInt(block.attributes().containsKey(START_KEY) ? block.attributes().get(START_KEY) : "1");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line is the fix for taking into account the starting position

@ouchadam ouchadam force-pushed the feature/adm/list-initial-value branch from 1effc1a to ead8cec Compare July 7, 2022 12:54
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

2.9% 2.9% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

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

LGTM

@ouchadam ouchadam merged commit cf22a76 into develop Jul 8, 2022
@ouchadam ouchadam deleted the feature/adm/list-initial-value branch July 8, 2022 08:13
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