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

#48 - Fix duplicate external link marks #50

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

pokornyd
Copy link
Member

Motivation

Fixes #48

Processing of external links incorrectly didn't reset link array when counter of child spans reached zero, resulting in duplicate links. Added a condition to mergeSpansAndMarks.

Checklist

  • Code follows coding conventions held in this repo
  • Automated tests have been added
  • Tests are passing
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

Transform a paragraph with multiple external links and ensure the marks are not duplicated in the resulting portable text (snapshot test was added).

@pokornyd pokornyd added this to the 1.1.0 milestone Apr 18, 2024
@pokornyd pokornyd requested review from IvanKiral and a team as code owners April 18, 2024 08:33
@pokornyd pokornyd changed the title 48 link duplication #48 - Fix duplicate external link marks Apr 18, 2024
@pokornyd pokornyd removed this from the 1.1.0 milestone Apr 18, 2024
@pokornyd pokornyd merged commit bcc16fc into main Apr 24, 2024
1 check passed
@pokornyd pokornyd deleted the 48-link-duplication branch April 24, 2024 11:50
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.

External link duplicating in portable text creating invalid HTML
2 participants