Hi all -
I have an obscure issue with how MMD import treats hash characters (#) in the first column. MMD treats a hash then a space then something else as a heading, and imports it as a section delimiter. However, I have a need for an MMD import to produce a section with text where a hash-then-space-then-something appears at the beginning of a line. I have the opportunity to escape these cases mechanically before import, but there does not appear to be an escape sequence for this in MMD that is interpolated on Scrivener import. For example, # is not treated as a header, but it appears in the section text as #, not #.
Or another way to put it: MMD import and export are not symmetrical. I can create a topic with hash-then-space-then-something at the beginning of a line then export it as MMD, and when I import the result as MMD it does not recreate the original section, but instead creates two sections. This makes sense given the goals of MMD’s presence in Scrivener (using Scrivener as an editor with one-way export), but it’s inconvenient in my case.
Is there a way to specify a point in the MMD source such that the result upon Scrivener import is a hash-then-space at the beginning of a line in a section?
Is there a way other than MMD to import multiple sections of text into Scrivener that preserves titles, order, and hierarchy? It looks like I could hack the MMD installation with my own scripts but I’d prefer not to. Is there an API for import/export extensions, or AppleScript calls for creating sections?
For the record: I’m trying to import and export another file format used for technical documentation, where "# " appears in code samples and must appear in the first column. I’m using MMD as an intermediate format because there does not appear to be another way to import and export from Scrivener that preserves section titles, order, and hierarchy. Export using this method works great, but import has this one issue. One workaround is to indent code samples on import and dedent them on export, but this requires that I preserve the indentation when editing in Scrivener, which is undesirable.