Yes, I know that. What I’m saying is, I don’t think most users know “paste as plain text” is even an option. It pretty much negates the usefulness of code blocks.
You can turn formatted pasting off globally in your site settings if you are a site owner.
Thanks for letting me know. I’m not the site owner, but I’ll bring up that option with the site owner and see what they think.
EDIT: @codinghorror Am I correct in assuming that there is no user-level setting?
I have been running into this too. Don’t know if it is a recent development but just started noticing it. I use discourse to reply to email often. When I do, I hit reply in the email and then copy and paste the entire email text into my discourse message. It recognizes one level of quoting correctly but encodes the second and third level. So I have to first paste into a plain text editor and do global search and replace, then edit, to get it to look as expected in discourse.
use ctrl+shift+v, it is your friend ![]()
If I want to lose all the other formatting too, then yes.
I will try this out next time and see how it turns out.
Thanks.
What about when you’re responding from your phone? At least iPhone doesn’t have the option to paste in plaintext.
Does iPhone retain formatting when copying? I’m not sure it even does?
It does. I just tried it.
Perhaps it would make sense to add a button on the reply menu for doing a plain text paste? Though space there is already a little tight on my iPhone 8…
@seanblue @tobiaseigen thanks for the report. I will definitely try to improve this. But it’s not in my current priority list.
I agree, a plain text menu option would be great when I’m working from my phone.
我试着通读所有帖子,但在读完前几篇后就开始略读了。
还尝试了在线转换器:
\+ exist
A \= b
但它们没有将 \ 转换为 \\,因此代码\text 显示为:
+ exist
A = b
我们的网站(SWI-Prolog)是面向 Prolog 编程语言 SWI-Prolog 的社区,许多帖子包含 Prolog 源代码。由于 Prolog 是一种基于三个基本逻辑运算符(and、or 和 not)的逻辑编程语言,而 not 在与常用运算符一起使用时通常用字符 \ 表示,例如 \=/2 和 \+/1,并且 Markdown 将 \ 用作 转义字符,因此当这些运算符以行内形式粘贴(而非在代码示例中)时,通常不会显示为 \= 或 \+,而是显示为 = 或 +,因为 Markdown 转换过程会“吃掉”\,误以为它是转义符。
这个问题能否修复?![]()
你需要将其粘贴到代码块中,所以请输入三个反引号,按 enter,然后粘贴?
谢谢,
大多数用户会用 ```prolog 和 ``` 来包裹代码块,我也在 帖子 中为那些不这样做的用户做了说明。
问题出现在行内文本中。众所周知,许多用户不会仔细检查他们发布的内容,即使检查了,也很容易漏掉缺失的 \。![]()
以下是给 SWI-Prolog 用户的 帖子 的详细说明:
如果您在行内文本中使用 \ 字符,例如 \= 或 \+,它会被转换为 = 或 +,这通常不是您想要的结果。虽然 Discourse 会智能地将粘贴的文本转换为 HTML,但它也使用了 Markdown,而 Markdown 将 \ 用作转义字符。
错误示例:= 和 +。
对于行内代码,只需用 ` 包裹文本,例如 `\=` 或 `\+`,显示效果为 \= 或 \+。
或者
只需将 \ 重复两次,例如粘贴 \\= 或 \\+,显示效果为 \= 或 \+。
不过,如果您有多行代码,请用 ```prolog 和 ``` 包裹代码部分,代码部分将由 Prolog 源代码转换器处理,从而保留 \ 字符。
A \= b.
\+ true.
即使我在粘贴这段内容到这里时,也不得不回到原始 HTML 并复制 HTML 代码而不是纯文本,以确保内容正确无误。
我将其标记为已完成!@vinothkannans 做得太棒了。
未来的改进可以在新的 bug 或功能主题中提出。