粘贴富文本到 Markdown 时添加了多余空格

Not sure if this is intentional / necessary for Markdown related reasons, but just noticed when I pasted some rich text into the composer, strings with formatting (bold / italic) seem to have extra spaces inserted before and after the * or ** tags.

See example here e.g. the URL in the quoted text or the bolded **SPRING2019** near the bottom.

The quoted text above was copied from a web page; the below “sale” text copied from an email. Not sure if this always happens but at least two sources where I’m seeing it.

3 个赞

This bug has existed for quite a while @vinothkannans I’ve noticed it many times.

10 个赞

我已经测试过从电子邮件(Gmail)、Google 文档、Microsoft Word 和普通 HTML 网页复制并粘贴文本的情况——所有这些内容来源都会在粗体和斜体文本周围添加额外的空格。内联代码块也会添加额外的空格,但删除线文本则不会。例如,如果我从网站复制文本并粘贴到编辑器中,会出现以下情况:

由于自动转换为 WYSIWYG Markdown 非常便捷,我发现自己经常先粘贴到编辑器中,然后在另一个程序(如 Vim 或 Notepad++)中使用正则表达式删除多余的空格,再粘贴回去。这有点像是变通方法,但比起保存文件并使用 Pandoc 获取 Markdown 还是要方便一些。

只要添加这些空格并非 RTF/HTML 粘贴所必需,那么不添加这些空格岂不是更好?

6 个赞

此问题已根据以下内容修复:

:confetti_ball:

6 个赞