# 粘贴的 URL 在用作空格时处理字符不当（即使是正确使用）

**URL:** <https://meta.discourse.org/t/pasted-urls-process-characters-improperly-when-they-are-used-properly-as-spaces/391836>\
**Category:** Bug\
**Tags:** composer\
**Created:** [2025年十二月21日 04:11 UTC](https://meta.discourse.org/t/pasted-urls-process-characters-improperly-when-they-are-used-properly-as-spaces/391836 "2025-12-21T04:11:49Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![MentalNomad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalnomad/32/95159_2.png) [@MentalNomad](https://meta.discourse.org/u/MentalNomad)\
**Post date:** [2025年十二月21日 04:11 UTC](https://meta.discourse.org/t/pasted-urls-process-characters-improperly-when-they-are-used-properly-as-spaces/391836/1 "2025-12-21T04:11:49Z")

</div>

接续自 [Rich Text Editor 中粘贴的 URL 未正确转义波浪号字符](https://meta.discourse.org/t/pasted-urls-in-rich-text-editor-improperly-escape-tilde-character/377739/4) 的讨论：

重现步骤：

> **[Frink System Solver](https://frinklang.org/fsp/solve2.fsp?equations=a%2B%3D%2B3%2Bb%2B%2B%2Bc&solveFor=&f=&ev=on&sel_a=S&val_a=&sel_b=S&val_b=&sel_c=L&val_c=299792458%2Bm%2Bs%5E-1&resultAs=)**

我在编辑器中粘贴了上面的 URL：  
`https://frinklang.org/fsp/solve2.fsp?equations=a+%3D+3+b+%2B+c&solveFor=&f=&ev=on&sel_a=S&val_a=&sel_b=S&val_b=&sel_c=L&val_c=299792458+m+s%5E-1&resultAs=`

点击链接后应有的正确响应是：

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/a/c/cac8591d489416958f801daa4f46ac32d4c16dd3.png)

但 Discourse 渲染后的该 URL 是：  
`https://frinklang.org/fsp/solve2.fsp?equations=a%2B%3D%2B3%2Bb%2B%2B%2Bc&solveFor=&f=&ev=on&sel_a=S&val_a=&sel_b=S&val_b=&sel_c=L&val_c=299792458%2Bm%2Bs%5E-1&resultAs=`

注意 `%2B` 替换了 `+` 字符。这导致失败，并产生以下结果：

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/3/f/43fbf515a427ff0b879bde78bce0e11590ab87d3.png)

测试超链接工具：

[Discourse-Made-Hyperlink](https://frinklang.org/fsp/solve2.fsp?equations=a+%253D+3+b+%252B+c&solveFor=&f=&ev=on&sel_a=S&val_a=&sel_b=S&val_b=&sel_c=L&val_c=299792458+m+s%5E-1&resultAs=)

Discourse 链接工具渲染的 URL：  
`https://frinklang.org/fsp/solve2.fsp?equations=a%2B%3D%2B3%2Bb%2B%2B%2Bc&solveFor=&f=&ev=on&sel_a=S&val_a=&sel_b=S&val_b=&sel_c=L&val_c=299792458%2Bm%2Bs%5E-1&resultAs=`

这也会失败，显示如下：

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/d/8/ad81e795d037ac4a4705add11de87f1615c5bfe9.png)

我不完全确定哪里出了问题，但我认为问题在于 `+` 字符，它本应是空格，却被错误地处理成了字面上的加号。

在 URL 中使用 `+` 代表空格是符合标准的，所以这可能也影响了以这种方式使用 `+` 字符的其他网站/系统。

---

_[View the full topic](https://meta.discourse.org/t/pasted-urls-process-characters-improperly-when-they-are-used-properly-as-spaces/391836)._
