为什么纯文本技术文章经常将术语括在反引号和单引号内?
我喜欢从网络上保存有用的文本较多的页面的本地副本,这样我就可以通过修改标记以包含 CSS 来练习改善它们的外观。
我注意到页面上的某些文本通常由“和”分隔。
这有充分的理由吗?如果我认为这些引用是有充分理由的,我想使用脚本自动进行修改。例如,它是特定创作工具的副产品吗?
我尝试搜索此内容,但搜索引擎将其视为空或不完整的字符串,并且不会给出有意义的结果。
单引号示例 (` ') 可以在 Eric Raymond 的 Cathedral 和集市:
问题是这样的:假设 Locke 上一个名为“joe”的人给我发了邮件。如果我把邮件取到 snark,然后尝试回复它,我的邮件发送者会很高兴地尝试将其发送给 snark 上不存在的“乔”。手动编辑回复地址以添加“@ccil.org”很快就会变得非常痛苦。
I like to save local copies of useful text-heavy pages from the web so I can practice improving their appearance by modifying the markup to include CSS.
I've noticed that some text on the pages is often delimited by ` and '.
Is there a good reason for this? I'd like to do my modifications automatically with a script if I thought these quotes were there for a good reason. Is it, for example, a byproduct of a particular authoring tool?
I have tried to search for this, but search engines treat it like empty or incomplete strings and don't give meaningful results.
A single quote example (` ') can be found in Eric Raymond's Cathedral and the Bazaar:
The problem was this: suppose someone named `joe' on locke sent me mail. If I fetched the mail to snark and then tried to reply to it, my mailer would cheerfully try to ship it to a nonexistent `joe' on snark. Hand-editing reply addresses to tack on `@ccil.org' quickly got to be a serious pain.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Eric Raymond 文章的例子是 Unicode 之前时代的人们试图通过使用不再适用的约定来“改进”文本排版的典型例子。引用样式
`'
就是典型的例子。它也用在 LaTeX 中(它会自动将其转换为正确的印刷单引号''
)。您还可以在 Eric 的文章中看到其他 ASCII 工件:例如,他使用“
--
”而不是“正确的”破折号“–
”(大量的人们这样做是因为默认的 Windows 键盘上不存在破折号)。因此,它是对 Unicode 字体(或者一般来说:缺乏这些印刷功能的字体)支持并不广泛的时代的遗物。
The example of Eric Raymond’s essay is a typical example of people from pre-Unicode eras trying to “improve” the typography of their text by using conventions that no longer hold. The quoting style
`'
is typical of that. It’s also used in LaTeX (which automatically converts it to correct typographical single quotes‘’
).You can see other ASCII artifacts in Eric’s essay, too: for example, he uses “
--
” instead of a “correct” dash “–
” (an awful lot of people do this, since the dash doesn’t exist on default Windows keyboards).As such, it’s a relic from a time where support for Unicode fonts (or generally: fonts lacking these typographical features) wasn’t widespread.
这:
是在仅 ASCII 环境中工作的智能引号的视觉效果。
我个人根本不会推荐它。 ` 不是一个开放引号,它是一个严重的重音,根据我的口味,由此产生的引号的不平衡外观比仅使用“直引号”更糟糕。 “双假引号”甚至更难看。
你会发现一些德国人同时使用重音和锐音重音字符来输入假智能引号:“像这样”。这与 ASCII 不兼容(它使用 ISO-8859 -1 扩展字符),它仍然很丑陋,但他们这样做是因为德语键盘布局上存在重音字符,使它们易于键入(而且他们不知道更好。)
实际上,我们应该有适当的 ' 。智能引号可以“在键盘上”进行“直接”输入,这将解决这些问题,并将虚假的自动智能引号功能(包括弄乱您的问题标题的愚蠢的 StackOverflow 功能)放回到它们所属的位桶中。 (虽然实际上......我已经有了。)
This:
is a visual affectation for smart quotes that works in ASCII-only environments.
I personally wouldn't recommend it at all. ` is not an open-quote, it's a grave accent, and the resulting lop-sided look of the quotes is, to my tastes, worse than just using 'straight quotes'. ``Double faux-quotes" are even uglier.
You'll find some Germans type faux-smart-quotes using both the grave and acute accent characters: `like this´. This is not ASCII-compatible (it uses an ISO-8859-1 extended character) and it's still quite ugly, but they do it because the accent characters are present on the German keyboard layout, making them easy to type. (And they don't know any better.)
Really we should have proper ‘smart quotes’ available “on the keyboard” for «direct» typing. That would solve these problems and banish bogus auto-smart-quote features — including the silly StackOverflow feature that messed up your question title — back to the bitbucket where they belong. (Though actually... I already have.)
HTML 则不然。只有
'
和"
字符可用于分隔属性值(这是唯一可以在 HTML 中分隔的字符串)。人们编写文本(恰好被标记) HTML)可以使用“,”,'和',但这只是使用引号书写。
HTML doesn't. Only
'
and"
characters may be used to delimit attribute values (which are the only strings that can be delimited in HTML).People writing text (which happens to be marked up with HTML) may use “,”,‘ and ’, but that is just writing using quote marks.
自网络问世以来,这种引号样式一直是(注意:不是唯一的)纯文本文件中可接受的引用样式。这与 html 无关——它在 html 文本文件中是可以接受的,但早于 html。
This style of quote marks has been an (note: not the only) accepted style of quoting in plain text files since before the web. This is nothing to do with html specifically --- it is acceptable in html text files, but predates html.
HTML4 和 HTML5 允许大引号作为标记中的属性值分隔符。在搜索引擎中搜索“curly Quotes html”会弹出几个页面,其中第一个页面 Curling Quotes in HTML, XML and SGML 描述了一些删除错误引号的工具,这与您要求的相反,但对此类文件执行正确的操作。
您的评论表明您的意思是在文本中而不是在标记中使用反引号和引号。这是当时 usenet 上相当常见的样式,因为反引号是 ASCII,但大引号不是。要在文本中插入反引号,请在输入文本时按键盘上的反引号键。
Neither HTML4 nor HTML5 allow curly quotes as attribute value delimiters in the markup. Searching for "curly quotes html" in search engines throws up a few pages, the first of which Curling Quotes in HTML, XML and SGML describes some tools to remove erroneous quotes, which is the opposite of what you ask for but the right thing to do with such files.
Your comment indicates that you mean having backtick and quote in the text, rather than in the markup. This was a fairly common style on usenet back in the day, as backtick is ASCII but curly quotes aren't. To insert a backtick into your text, press the backtick key on your keyboard when typing it in.
我认为这是你的编辑器的产物——也许你打开了智能引号。 HTML 中的字符串由一对单引号或双引号分隔,而不是智能引号字符。
I think this is an artifact of your editor -- perhaps you have smart quotes turned on. Strings in HTML are delimited by either a pair of single- or double-quotes, not smart quote characters.