Thanks everyone. I evidently wasn't clear enough on where I'm at and what I was hoping for.
I know how to insert real curly quote characters into TiddlyWiki using my preferred input method (I'm on Linux actually, @springer), and I regularly do this. However, as with any input method that I'm aware of, it requires extra keypresses on top of straight quotes, which would be nice to avoid if possible. All of my other editing environments, from word processors to text editors to document preparation systems, support one of two ways of allowing you to type straight quotes but display curly quotes:
- automatically upgrading straight quotes when typing them
- automatically upgrading straight quotes when rendering them from source, either during a compilation phase or when displaying the document
The first solution probably isn't too practical for TiddlyWiki, since as others have mentioned there is often need to type straight quotes. (In vim I can press ^V " for a straight quote with curly-quotes on, but that's not supported in CodeMirror.)
smartquotes.js and similar tools work at render time, and they have no difficulty avoiding accidentally curling quotation marks that are part of code. They automatically skip anything within HTML tags, scripts, <pre> blocks, and so on. They dynamically replace the quotation marks within the DOM after the page loads, so that the real characters are there afterwards. Another set of tools (used in tools like XeTeX, Sphinx, Jekyll, and some Markdown renderers) replace at compile time (in TiddlyWiki, this would presumably be during parsing).
@Anjar, that's a pretty slick solution with ::before and ::after, but not being able to copy the quotation marks is more annoying to me than having to spend a bit longer typing them at the start.
I think a solution that's better than what I'm currently doing needs to:
- understand the semantic role of the quotation mark in the text so that it knows not to replace quotes that are part of code;
- work completely automatically, converting " characters to the appropriate curly versions when a tiddler or other wikitext is wikified (if it screws up occasionally, I can go back and put a raw quote that goes the right direction in)
- actually place the new character within the DOM so that it copies correctly.
If we don't know of anything that exists and adding some feature that does this to TiddlyWiki doesn't seem workable, that's a fine answer. It just seems a little odd to me that TiddlyWiki is the only serious modern document tool I use that doesn't use a library like this.