Opened 14 years ago
Closed 8 years ago
#9984 closed enhancement (wontfix)
Provide markup for HTML's <q></q>
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | wiki system | Version: | |
Severity: | normal | Keywords: | bitesized |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
There is no way to provide the equivalent of HTML quoting. The quoting effect itself can be achieved using
{{{#!html <q>quote me, baby</q> }}}
but this enforces a new paragraph; it can't be done inline, even with a style attribute on the <q>.
Suggest: double-double quote:
This dummy area is a ""project"" with its own Trac environment.
would result in
This dummy area is a "project" with its own Trac environment.
only with browser-appropriate quoting (e.g. curly quotes) on the word project.
Attachments (0)
Change History (7)
comment:1 by , 14 years ago
Keywords: | bitesized added |
---|---|
Milestone: | → next-major-0.1X |
comment:2 by , 14 years ago
Well, this can be done inline if you use the macro call syntax for the html
processor, like that:
Wiki Markup | Display |
---|---|
... [[html(<q>this can be done inline</q>)]] he said. |
… |
Now for a more direct syntax, there is little evidence that this is supported elsewhere (I didn't find anything relevant on http://wikimatrix.org/ though I suppose some wiki must support <q>…</q> - which is a no go here). There's some discussion about this on CreoleWiki:Quoting and its talk page, but no evidence that it's actually used anywhere.
My personal favorite would be to just turn "…" into quotes, as that's what is usually meant by the aptly named (double) quote character. However, even if rendered <q>…</q> elements are not distinguishable from the corresponding "…", the text selection is not and that will be problematic for copy/pasting. Maybe we could just suppress the default CSS (i.e. q::before, q::after {content: '"'}
, at least in Chrome) and emit <q>"…"</q>?
comment:3 by , 14 years ago
However, even if rendered <q>…</q> elements are not distinguishable from the corresponding "…", the text selection is not and that will be problematic for copy/pasting.
What? Does that sentence mean what you intended?
The <q></q> rendering is for presentation in wiki to get the curly quotes. If you translate a regular double-quote into curly quotes, that will break the copy/paste for the cases where the double-quote is intended to be literal — which of course is a pretty common use case. Plus your parser needs to figure out when two double-quotes separated by text are actually supposed to be a matched pair.
See ticket:4196 where I asked for less aggressive wikification of common text instances. (Despite that ticket being closed, the wiki is still too aggressive for me.)
comment:5 by , 14 years ago
I wrote:
If you translate a regular double-quote into curly quotes, that will break the copy/paste for the cases where the double-quote is intended to be literal
I slightly misspoke, however: copying a <q>-embedded text uses the ASCII double-quote for the text/plain flavor, which is how it would paste in the wiki. The rich-text flavor of the buffer has the curly quotes. (This is copying via Firefox on Windows, other browsers may be different.)
Generally, my preference for a software tool is for regular text to be literal unless explicitly marked up; modifying a plain double-quote is not desired.
follow-up: 7 comment:6 by , 8 years ago
I'm not convinced this is very useful, intuitive or missed syntax. Also a plugin could provide it:
from trac.util.html import tag from trac.core import Component, implements from trac.wiki.api import IWikiSyntaxProvider from trac.wiki.formatter import format_to_oneliner class WikiQuoteSyntax(Component): implements(IWikiSyntaxProvider) def get_link_resolvers(self): return [] def get_wiki_syntax(self): yield (r'""(?P<quoted>.+?)""', self._format_quotes) def _format_quotes(self, formatter, ns, match): quoted = match.group("quoted") formatted = format_to_oneliner(self.env, formatter.context, quoted) return tag.q(formatted)
comment:7 by , 8 years ago
Milestone: | next-major-releases |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Replying to Peter Suter:
I'm not convinced this is very useful, intuitive or missed syntax.
Agreed. If there are more requests and justification for it, we can revisit.
Why not. Shouldn't be too difficult to implement. Although I'm not sure about the double-double quote.