是否有办法用“监视词”(或其他方式)来“修复”--到en破折号的映射?

For probably perfectly-well intended reasons, Discourse replaces -- with , an en dash, and --- with , an em dash.

I find this a minor irritation, because when people use -- in writing in email (or on the olden days in a typewriter), they almost always mean to use an em dash. En dash is only used in several fairly obscure cases, like range of numbers or times (“The party goes from 7–9 pm”), scores or voting results (“She won in a landslide, 78–22!”), or occasionally for complex adjectives (“World War I–era”). All of these use cases are represented by a single - character on a typewriter or normal keyboard, and most people’s writings.

So basically, what Discourse does is almost always wrong (for a highly-pedantic value of “wrong”).

I feel like suggesting that this is a bug that should be fixed globally is probably tilting at windmills, so I’m wondering how to configure my site locally so it at least that doesn’t bug me. I thought about using the word replacement feature, but that seems to also mess up cases where one uses --------- or similar for horizontal rules or headings in Markdown.

Any other ideas?

2 个赞

You could turn it off using the enable_markdown_typographer admin setting? It would stop the → and ™ etc ones as well, but it seems the simplest way.

1 个赞

I like the other ones. This one is just Wrong™.

好的,这个还是让我很困扰。我意识到这不仅仅是“我的”网站有问题。

Markdown 的吸引力之一——甚至超过其他一些轻量级文本标记语言——在于普通的 ASCII 文本约定得以保留,而且你通常不必做任何奇怪的事情就能让纯文本段落按预期渲染。这破坏了这一点。 [1]

那么,我换个方式问。你们是否愿意修改 Discourse 中使用的 Markdown 排版功能,将 -- 渲染成长破折号而不是短破折号? [2]

感谢您的考虑。:slight_smile:


  1. 同样,对于“破坏”这个词来说,这有点吹毛求疵,但你知道,仍然是这样 ↩︎

  2. 也就是说,通常正确的“”而不是太短的“”? ↩︎

1 个赞

嗯,我们不能简单地更改规则,因为短破折号长破折号的首选用法似乎因您的语言和国家/地区而异。在德语中,当我们写 -- 时,我们绝对想要短破折号,而且我认为法语和英式英语也可能如此,至少在我浏览了 Dash - Wikipedia 之后,我的印象是这样的。

站点设置是否足够? Discourse 是否应根据用户的界面语言自动在短破折号长破折号之间切换?我不确定最佳解决方案是什么…… :thinking:

我真的没有什么意见。我声称很少有人能看出区别或在意它。

一些无关紧要的…

~~我所知道的我喜欢 → ™ 等,但创建表格很麻烦,因为 - - 会变成 — ~~

我编辑了那个帖子,因为我得到建议说单个 - 就足够了。我不知道 — 每天都有新东西。

真有趣!今天我学到了!

按语言区分可能很有趣——尽管我满足于一种更改它的方法。(https://www.npmjs.com/package/markdown-it-replacements)

1 个赞

今天,我意识到该选项的帮助文本在 嘲笑我。它说:

使用排版规则提高文本的可读性:将直引号 ' 替换为弯引号 ’,(tm) 替换为符号,-- 替换为长破折号 – 等

是长破折号。

但亲爱的朋友们,那 是短破折号

哦,这人性!

4 个赞

这里真的没有办法让所有人都满意。

出于好奇,我想知道……

[root@fedora-39 /]# grep DASH /usr/share/X11/locale/en_US.UTF-8/Compose 
<Multi_key> <minus> <minus> <period>    : "–"    U2013 # EN DASH
<Multi_key> <minus> <minus> <minus>     : "—"    U2014 # EM DASH

看起来 Fedora 本身也同意两个连字符 → (en dash)和三个连字符 → (em dash)::grin:

2 个赞