blacksmithgu / datacore

Work-in-progress successor to Dataview with a focus on UX and speed.
MIT License
1.25k stars 11 forks source link

Fix emptyLines always returning false #33

Closed RyotaUshio closed 7 months ago

RyotaUshio commented 7 months ago

This is a very simple error, but prevented any markdown file that has its first heading at line zero, for example:

# Heading

> [!NOTE]
> Hello, world

because this if condition is always satisfied as long as there is at least one heading. https://github.com/blacksmithgu/datacore/blob/5fdeb17522770fa75b6a4083c6d850e83c13a6b9/src/index/import/markdown.ts#L67

In this case, the section with $ordinal == 0 should not be created, but it is created and it overwrites the original section with $ordinal == 1.