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

For inline code, ZWPS changes to ZWNBSP #11248

Open
Vanessa219 opened this issue May 4, 2024 · 14 comments
Open

For inline code, ZWPS changes to ZWNBSP #11248

Vanessa219 opened this issue May 4, 2024 · 14 comments
Assignees

Comments

@Vanessa219
Copy link
Member

Vanessa219 commented May 4, 2024

https://ld246.com/article/1714223772557/comment/1714313897365?r=Vanessa#comments

@Vanessa219
Copy link
Member Author

需注意:

  1. 粘贴 wysiswyg/index.ts
  2. 复制 wysiswyg/index.ts
  3. 设置行内元素
    if (currentNewNode.nodeType !== 3 && ["code", "tag", "kbd"].includes(type)) {

@TCOTC

This comment was marked as outdated.

@TCOTC
Copy link
Contributor

TCOTC commented Oct 2, 2024

研究了一下,改用 ZWNBSP 确实还会引入新的问题,所以改了也没用:

image

行级代码的样式之所以会留在上一行的末尾,本质是因为 ZWPS 的位置不对,不应该在 span 元素内,否则会在 span 标签之后换行了:

image

放到 span 元素外的话就不会有换行样式的问题了,会在 span 标签之前换行:

image

@Vanessa219
Copy link
Member Author

零宽空格放前面的话光标就不能在代码块内且位于e的前面。
QQ_1729135693353

@TCOTC
Copy link
Contributor

TCOTC commented Oct 17, 2024

我试了下感觉可以这样:code 两侧用 ​ ,里面用 ⁠

image

另外 kbd 也有跟 code 同样的样式问题

image

@Vanessa219
Copy link
Member Author

这个使用光标移动就不对了,最后一个1前面需要多使用一次左键。

@TCOTC
Copy link
Contributor

TCOTC commented Oct 17, 2024

刚刚发现给行内元素使用 display: inline-block; 好像就行了,不过会对原有样式有点影响:

default.webm

@Vanessa219
Copy link
Member Author

这样的话鼠标在代码块内上下会有问题。

@TCOTC
Copy link
Contributor

TCOTC commented Oct 19, 2024

似乎无解了?

@Vanessa219
Copy link
Member Author

好像可以用 zwnbsp + word-break: keep-all;

@TCOTC
Copy link
Contributor

TCOTC commented Oct 20, 2024

我这里好像不行:

image

@TCOTC
Copy link
Contributor

TCOTC commented Oct 20, 2024

感觉应该解决不了了,我试了 Notion FlowUs Wolai 飞书 语雀,都没解决这个问题

@TCOTC
Copy link
Contributor

TCOTC commented Oct 20, 2024

刚刚发现还有个样式问题,输入一堆空格的话会超出边界:

image

@Vanessa219
Copy link
Member Author

需要使用在父元素上

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

No branches or pull requests

3 participants