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

Fix - anchor tag breaks into parts with partial styling #60

Merged
merged 11 commits into from
May 31, 2022

Conversation

bartgloudemans
Copy link
Contributor

@bartgloudemans bartgloudemans commented May 27, 2022

Proposed fix for #59

this is a breaking change as Link->wrapper is discarded

this closes #59

Copy link
Owner

@nadar nadar left a comment

Choose a reason for hiding this comment

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

Hi @bartgloudemans thanks for the PR (and issue!). This will break quite a few things and i need to take a deeper look. So the unit tests should not fail.

The php docs and @SInCE tags are missing, also we need to make a major release (which is not a problem, just saying)

@bartgloudemans
Copy link
Contributor Author

bartgloudemans commented May 27, 2022

@nadar thanks for allowing the tests to run.
I will pay additional attention to docs/tags as you mentioned and try and fix the failing checks.

This proposed fix is one approach to tackle the issue, based on my limited knowledge of the quill-delta-parser. I'm curious if you maybe have a completely different approach in mind that I'm overlooking.
I'm especially interested because this link+italic example is a dressed down version of the issue I'm actually having with a more complex custom listener. My custom listener acts instead of the link listener and adds a complex piece of html into the rendered html. And that complex html is much harder to break down than the simple "wrapperOpen", "wrapperMiddle" and "wrapperClose".

@nadar
Copy link
Owner

nadar commented May 30, 2022

@bartgloudemans thanks for the work! I will take a closer look within the next 48hours.

(edited: but in general, if the unit tests work, which cover a lot of different content situations, your proposed fix seems to be a good solution anyhow!)

I'm especially interested because this link+italic example is a dressed down version of the issue I'm actually having with a more complex custom listener. My custom listener acts instead of the link listener and adds a complex piece of html into the rendered html. And that complex html is much harder to break down than the simple "wrapperOpen", "wrapperMiddle" and "wrapperClose".

Would you like to share your custom listener?

@bartgloudemans
Copy link
Contributor Author

In the mean time I've fixed my custom listener, it appeared not to be so complex after all.

The 'complexity' lies in the fact that Instead of a string attribute named 'wrapper', it renders a template based on dynamic data. So I needed to split up (explode()) the rendered template into 'wrapperOpen' and 'wrapperClose'. From there the approach is the same as in this PR.

Is there anything else you need from me to move this PR forward?

@nadar nadar merged commit bfcba46 into nadar:master May 31, 2022
@bartgloudemans bartgloudemans deleted the fix-issue-59 branch May 31, 2022 14:14
@nadar
Copy link
Owner

nadar commented Jun 1, 2022

@bartgloudemans thanks for the work, i really appreciate it. I will make some small changes in upgrade docs and release version 3.0 asap.

nadar added a commit that referenced this pull request Jun 2, 2022
* validate the fix first

* make sure styling of text does not break up anchor tag

* dependent test needs fixing

* be less ambiguous

* fix bad logic

* adjust code style

* redundant

* typo

* place since tag back

* Update Link.php

* Update CHANGELOG.md

Co-authored-by: Basil <git@nadar.io>
nadar added a commit that referenced this pull request Jun 2, 2022
* php 8.1

* php unit 8.0

* Fix - anchor tag breaks into parts with partial styling (#60)

* validate the fix first

* make sure styling of text does not break up anchor tag

* dependent test needs fixing

* be less ambiguous

* fix bad logic

* adjust code style

* redundant

* typo

* place since tag back

* Update Link.php

* Update CHANGELOG.md

Co-authored-by: Basil <git@nadar.io>

* tests and changelog

* typo

* update tests

* rm lockfile

* clear cache?

* add zip

* test v1

Co-authored-by: Bart <bart@supportthesystem.org>
@nadar
Copy link
Owner

nadar commented Jun 2, 2022

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.

Link with partially styled text breaks up in parts
2 participants