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

Swap open-vs-close tag order when converting Text to markup. #3163

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

slaarti
Copy link

@slaarti slaarti commented Oct 21, 2023

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Fixes #3155.

(I'm torn on whether this is a pleasingly simple solution or a solution that's too simple to possibly be correct. Still, it makes the test pass while making some improvement on making sure existing tags get closed before new ones are opened. I made an attempt at a more sophisticated effort to more closely track tag opening order and it took things to la-la-land, so I abandoned that and am calling this good enough.)

I'm torn on whether this is a pleasingly simple solution or a solution
that's too simple to possibly be correct. Still, it makes the test pass,
so it'll do as a first cut while I decide if I want to make a second,
more complex run at it.

(Possibly track the order open-tags were rendered to ensure that
multiple close-tags at a given offset get popped off in reverse open-tag
order?)
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (aabfd16) to head (cab14db).
Report is 323 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3163      +/-   ##
==========================================
- Coverage   98.30%   98.28%   -0.03%     
==========================================
  Files          74       74              
  Lines        8038     8043       +5     
==========================================
+ Hits         7902     7905       +3     
- Misses        136      138       +2     
Flag Coverage Δ
unittests 98.28% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willmcgugan
Copy link
Collaborator

Not convinced this is the solution. Suspect it will only work for the trivial case.

More tests might convince me...

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.

[BUG] Text markup property opens new span tags before closing old ones.
4 participants