Maybe toggleMark shouldn't expect perfect equality?
See original GitHub issueDo you want to request a feature or report a bug?
Not sure this is a bug
What’s the current behavior?
Currently, when you use toggleMark
, you need to pass the exact same object to make it work.
For example:
// Working
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })
// Not working
transform.toggleMark({ type: 'bold', data: { foo: 'bar' } })
transform.toggleMark('bold')
What’s the expected behavior?
Maybe when a String is passed, we should remove all the marks of that type, no matter the other properties? Just asking, not sure if this could have side effects. If you agree, I think I can make a pull request.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Remarks by President Biden in Address to a Joint Session ...
Americans always get up. Today, that's what we're doing: America is rising anew, choosing hope over fear, truth over lies, and light over ......
Read more >Every successful relationship is successful for the same exact ...
I asked 1500 people for relationship advice, and kept getting the same answers.
Read more >Mere Christianity - By CS Lewis Contents
Ever since I became a Christian I have thought that the best, perhaps the ... expect that all the planets were made to...
Read more >Why Be Honest If Honesty Doesn't Pay
We bet on the rational case for trust. Economists, ethicists, and business sages had persuaded us that honesty is the best policy, but...
Read more >AAMC MCAT Prep Physics Question Pack Solutions
So ultimately to find the number of half-lives, set two equations equal to one another. ... We said we're expecting half a wavelength,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@YurkaninRyan yup it’s definitely possible. We could allow that kind of logic with an extra option potentially, or treat it as the default and make the extra option the strict matching maybe.
As of https://github.com/ianstormtaylor/slate/pull/3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I’m going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding.