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

Avoid text split bug by using matchedText #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matuszewskijan
Copy link

@matuszewskijan matuszewskijan commented Aug 29, 2024

It's been ages till #5 was posted, but today I have faced exactly the same issue. It seems that the www.google.com string is causing everything to break, as tag.attrs.href and tag.innerHtml aren't good matchers for this case.

I have tested it with such long text and without the changes it was rendered like on the first screenshot, on the second screenshot version after fix:

- Visit google.com for your search needs.
- Just www.google.com
- You can also use https://google.com if you prefer a secure connection.
- Alternatively, http://www.google.com works as well.
- Don’t forget about www.google.co.uk for the UK-specific site.
- Here's a fun site: http://example.org.
- For your info, check out https://subdomain.example.net/page.
- Need a secure link? Try https://secure-site.com.
- You can reach out via email: [email protected].
- Another email option: [email protected].
- Feel free to call at (123) 456-7890.
- International number? +44 20 7946 0958 is what you need.
- Check ftp://ftp.example.com for the FTP site.
- For more information, try mailto:[email protected].

image
image
(The last example with mailto is my presentation mistake, it's correctly rendered after removing additional mailto: text)

As `tag.attrs.href` and `tag.innerHtml` weren't always an ideal matchers causing strange rendering errors.
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.

1 participant