-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Zero-width spaces cause unwanted wrapping / empty newlines before inline blocks #2231
Comments
Actually display: none on zero-width spans does cause issues. @ianstormtaylor what if we replace U+200B with U+FEFF (ZERO WIDTH NO-BREAK SPACE)? It seems to both fix the linebreak issue and doesn't breaking existing behaviour (for example adding text before inline block at a beginning of a line). |
@k7d good call, that sounds like a good solution to me! |
okay cool i'll pr |
k7d
added a commit
to WhimsicalCode/slate
that referenced
this issue
Oct 6, 2018
This fixes ianstormtaylor#2231 where a rogue empty line appears before an inline block.
4 tasks
k7d
added a commit
to WhimsicalCode/slate
that referenced
this issue
Oct 6, 2018
This fixes ianstormtaylor#2231 where a rogue empty line appears before an inline block.
jtadmor
pushed a commit
to jtadmor/slate
that referenced
this issue
Jan 22, 2019
…anstormtaylor#2234) This fixes ianstormtaylor#2231 where a rogue empty line appears before an inline block.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Bug
What's the current behavior?
Slate inserts span with zero-width spaces in front of inline blocks
starting at the begging of a line. If the inline block is longer than the line and doesn't have any whitespace in it, it causes a permanent newline before the block. Another sideeffect is that you cannot use key down to move down - the caret is just stuck there. This can be repeated with included links example. Just type some text without whitespace and add a link to it:
(see the empty line abobe "longlong..")
This is a common scenario when implementing automatic link wrapping (ie. if I paste a link I want it to get automatically converted to a clickable link).
For now my workaround is to just do this:
It fixes the issue and seem to not break anything (but I'm not 100% sure).
What's the expected behavior?
There should be no line breaks/empty lines before inline block in the above scenario.
The text was updated successfully, but these errors were encountered: