Creating new "smart pairs" doesn't work?
CompletedNot sure if I'm doing it wrong, or if there's a problem.
I don't like my computer to automatically convert straight quotes to curly quotes, so I have "Smart quote replacement" turned off in preferences. However, I do like the smart pairs feature in nvUltra (i.e., you type a " and it automatically gives you "" with your cursor in between).
I tried adding curly quotes (“” and ‘’) to the "smart pairs" field in the Editing pane of nvUltra's preferences. But it doesn't seem to do anything. Typing “ just gives me “, not “”. I do have "Enable Smart Pairs" checked.
-
The smart pair algorithm works with ASCII characters (which are single bytes). The curly quote characters you are referencing are multi-byte Unicode characters.
The "correct" way to handle smart quotes in MultiMarkdown is to use straight quotes in the text, which are automatically converted to curly quotes in the output (but remain straight quotes in the source text.)
I'll consider revisiting the algorithm again in the future to see if there is an efficient way to handle multibyte substitutions.F-
0 -
That makes sense. Thanks! One of these days I'll automate a search-and-replace. Most of my output needs to become rich text, and I have yet to find a great way to handle that (short of copying and pasting from previews in app or in Marked); rtf export seems to be problematic.
0 -
I'm not sure I follow you when you say that it is problematic to create rich text from plain text via Markdown/MultiMarkdown. That is sort of it's raison d'être...
If you mean simply creating RTF files specifically, then create ODT/FODT via MultiMarkdown and use LibreOffice to convert to any other format you like (Word formats, RTF, etc.) The RTF format is a bit of a mess, so there is not a lot of motivation for me to add it as a specific output format for MMD when LibreOffice can convert to so many more. I have offered (multiple times) to support anyone else who had an interest in working on RTF, but no one has taken me up on it over the years.
(LibreOffice has a command line interface, so you don't have to do this manually. Which is yet one more reason that I don't particularly care to spend hours and hours writing a converter... I very rarely need an RTF file, so spending a minute using LibreOffice to convert is worth it. )
0 -
I can convert my Markdown/MMD documents into RTF. That RTF, for whatever reason, doesn't always work for my needs.
What I mean for the most part is that if I open it in Google Docs, or paste it into a Google Doc or a Gmail message, not all of the formatting comes through. A big sticking point for me is CriticMarkup — I want to be able to mark changes, but have those marks carry through to the RTF. After much experimentation, I've found ways that mostly work, but they all involve a lot of steps or manual cleanup. Although my biggest use-case is Gmail and Google Docs (what I have to use at work), I've also had mixed success going to MS Word and other avenues.
I don't blame MMD, nvUltra, CriticMarkup, etc. (I suppose I do blame Google Docs, for not supporting any flavor of Markdown.) I also realize part of the problem may be my failure to find (and then, if possible, automate) the right combination of features and commands. I would love to just be able to choose a menu command and walk away with something I can paste where I want and get more or less the same formatting, but I realize that's a long shot.
I'll have to explore LibreOffice and its CLI. That may be the best approach. Thanks!
0 -
I'll dig more. But a couple of preliminary thoughts:
1. Re: CriticMarkup specifically -- It looks like that does better going to FODT instead of ODT. I'll have to look into that, as it is presumably an error on my end and not a limitation of the ODT format.
2. That said, trying the LibreOffice command line conversion doesn't seem to work when using a FODT document. It does work from the GUI, and preserves strike-throughs, underlines, highlights, and blue coloring for CriticMarkup notes. So for now, MultiMarkdown->FODT->LibreOffice GUI->RTF seems to work
3. Otherwise, you are at least in part bumping up against the limitations of RTF as a document format. In my experience, it is among the least standardized document formats ever, at least in terms of how it is handled on the editor/viewer end. The format spec itself may be perfectly fine, but apparently no one uses it. I have zero faith in RTF as an archival document format, as I suspect any change to one's workflow (new OS, new word processor, change in time zone, etc.) may cause dramatic or subtle re-interpretations of your document that you may or may not notice. (This is one of many reasons I spent so much time on MultiMarkdown. I have 100% faith in my ability to read a MultiMarkdown text file on any computer in the future, and in all likelihood could compile the MultiMarkdown source with minimal tweaks on just about any near-future OS. Worst case scenario, it would not be too big a task to write a new parser. And in reality, by the time computers are no longer able to run MultiMarkdown, they will be able to generate a parser on their own based on reading the existing examples/specs out there. :)
Fletcher
0 -
1. Found and fixed the issue that caused CriticMarkup styling to not be applied when converting to ODT. As a double check, converting ODT and FODT separately to RTF, and then diff'ing the two RTF files shows a single difference of "<space>" "<space><space>" in one line. At some point I may dig into what happened there, but not now.
2. Strangely, now when I use the command line it converts both ODT and FODT. And they generate identical output.
3. Comparing the GUI and command line RTF files does show one important difference, though. Captions that automatically generate a number don't work properly via the command line. So using the GUI is better (at this time anyway.)
0
Please sign in to leave a comment.
Comments
6 comments