Glad to hear it works for you.
Edit:
The script doesn’t need to check “DisplaySuffix”.
Now using this handler to get the name without suffix.
Yes to avoid interpretation as metadata. For other readers:
MultiMarkdown treats a first line containing a :
as metadata and hides it in rendered view (see MultiMarkdown Syntax Guide). In context of converting from RTF we don’t want a first line that contains a :
to be hidden, escaping prevents this. This capture makes it clear
- If the first line in the resulting markdown record contains a
:
and contains formatting there’s no problem. - If the first line isn’t formatted it will be treated as metadata if we don’t escape
:
. - Easiest way to handle this is to always escape if there’s a colon.
It is, there are so many options one can use, I didn’t get to read the whole User’s Guide yet. There might be formatting in your RTFs that isn’t covered from the script so it’s a good idea to read the guide and add everything that you might need.
I’ve found an option that might make it possible to convert RTFDs too:
--extract-media=DIR
Extract images and other media contained in or linked from the
source document to the path DIR, creating it if necessary, and
adjust the images references in the document so they point to
the extracted files. If the source format is a binary container
(docx, epub, or odt), the media is extracted from the container
and the original filenames are used. Otherwise the media is
read from the file system or downloaded, and new filenames are
constructed based on SHA1 hashes of the contents.
I’ll try that now