TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Trouble with Q Quotes

2 点作者 vogon_laureate将近 2 年前

1 comment

gwern将近 2 年前
&gt; I lack the web wizardry skills to fix this in a reliable fashion. I guess you’d have to insert invisible elements containing the quote characters you want copied, but I think at that point just give up and don’t even use the q element.<p>Oh, I know this one! We tried &lt;q&gt; for years on my website and gave up (<a href="https:&#x2F;&#x2F;gwern.net&#x2F;design-graveyard#quote-syntax-highlighting" rel="nofollow noreferrer">https:&#x2F;&#x2F;gwern.net&#x2F;design-graveyard#quote-syntax-highlighting</a>) for a variety of reasons, but mostly that it caused endless problems with all other kinds of styling or layout. It became clear that &lt;q&gt; is just too far off the CSS&#x2F;browser happy path to risk using; no one thinks about it and no one will fix your bugs and you&#x27;re on your own.<p>However, the copy-paste issue wasn&#x27;t too bad. You would use a copy-paste listener: some JS which fires when the user does a copy-paste, and rewrites the the &lt;q&gt;s to literal Unicode&#x2F;ASCII quotes. Since you will often wind up using a copy-paste listener for other things (in our case, to remove soft hyphens and replace rendered-math equations with the original LaTeX), this is not a dealbreaker.