-
Notifications
You must be signed in to change notification settings - Fork 94
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
Overlapping styles and entities in convertToHTML not working when intersecting no style #46
Comments
Should resulting tags overlap, or be close/opened around the intersect? In the Intersect start example, for example, which of these possibilities would be desired?
For HTML5, either one should be valid. Is there any preference here? |
I think the latter is what we want here - it's how overlapping style ranges currently work and I'm not so sure the first is valid. |
closed via #57 🎉 |
@benbriggs Found a breaking case: Given that you style text not overlapping to links, and have more that one link in text block, style is left on stack and error is thrown. Example: testing testing testing testing testing
Error is thrown in blockInlineStyles: https://github.com/HubSpot/draft-convert/blob/master/src/blockInlineStyles.js#L119 |
Hmm I can't seem to reproduce that @liyantang, can you provide a failing test? Here's one I tried to mimic your example that passes:
|
Example:
|
Hmm...that still passes for me as well (after adding wrapping |
I am on the latest of master branch of 1.4.5. I added this test to the existing tests in converToHTML.js and it throws the error for me. |
Strange! Could you try submitting it as a PR so that the test runs in Travis and we can have an isolated place to verify that it can be fixed? Thanks for digging into this! |
Perfect, thanks! I'll dig into it now. |
Great, thanks! |
Fix is landed in 1.4.6 - thanks so much for your help @liyantang! |
I just noticed the release of #43 which is super cool. Unfortunately, it does not work for intersections situations, which is problematic.
Here is my code:
Overlapping styles
1. Add link
2. Add bold intersecting link
3. Result
4. Render
Situation
Intersect start
Result:
Code:
Intersect end
Result:
Code:
The text was updated successfully, but these errors were encountered: