Skip to content

Commit

Permalink
feat(Hierarchy Note): ✨ Allow yaml frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Aug 21, 2021
1 parent 0407179 commit 88f0499
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,16 @@ export default class BreadcrumbsPlugin extends Plugin {
}

hierarchyNoteAdjList = (str: string) => {
let noteContent = str;
const settings = this.settings;
const layers = str.split("\n").filter((line) => line);

const yamlRegex = new RegExp(/^---.*/);
const hasYaml = !!noteContent.match(yamlRegex);
if (hasYaml) {
noteContent = noteContent.split("---").slice(2).join("---");
}

const layers = noteContent.split("\n").filter((line) => line);

const depth = (line: string) => line.split("-")[0].length;

Expand Down

0 comments on commit 88f0499

Please sign in to comment.