First header in transcluded file lost due to colon


I played around with the file transclusion for markdown files today and I might have hit a minor bug.
For testing I created two markdown files from using the built-in template for Cornell notes.

Then I created a third markdown file which just had two lines with file transclusions. It does show me a combination of both but the first header for each transcluded file was missing.
I then created some simpler files on may own and for those everything worked fine - including the first header. Finally noticed that the files generated from the template include colons. So I assume transclusion wants to skip any metadata entries at the top of the transcluded files. However this is not metadata but a valid header.
Can this be fixed or would it violate MultiMarkdown compatibility ? If it can’t be fixed maybe worthwhile to change the templates and add a note about this in the help section to not use colons in the first header of a transcluded file.

Thx !

I believe in order to achieve that you must have a blank line preceding it (even if the text is right at the start of the markdown record).


Welcome @longshot

@Stephen_C is correct and MultiMarkdown metadata is already discussed in the Help:Help > Documentation > Documents > Markdown Documents > Metadata

Thanks for the quick reply. Please note that initially this was not about metadata at all. I was just trying file transclusion using two files created from a system template (which does not include metadata).

The template in question is adding the colon in the header in the first line - something like this:

# Area : Topic

This seems to work just fine as long you use the file as standalone. But when you transclude it into another document the line is skipped.

Comparing this with the help section you shared, there is a slight difference. I see how the software cannot distinguish between a line “Re: OCR” and a proper metadata entry, so hence the workaround of adding a leading blank line. In case of “# Area: Topic” this is not even valid metadata key syntax (must start with ASCII letter or digit as per spec) so DT could react differently and leave the line alone (same as it seems to do when the file is viewed in standalone mode). Given that files frequently start with some header it seems like a good thing to do.

In any case, not a biggie. Was just thinking a caveat in the transclusion documentation might help others hitting the same scenario. I made a mental note to make it a habit to add a blank line at the beginning of a file if it does not have metadata … just in case I want to transclude it some day :slight_smile:



No problem :slight_smile: