Skip to content

Commit

Permalink
enhance(pods): json pod import fnames as links
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Sep 14, 2020
1 parent 363285f commit 8113594
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/pods-core/src/builtin/JSONPod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class JSONImportPod extends ImportPodBaseV2<ImportPodConfig> {
}
const acc: string[] = [""];
_.forEach(notes, (n) => {
acc.push(`# ${n.fname}`);
acc.push(`# [[${n.fname}]]`);
acc.push(n.renderBody());
acc.push("---");
});
Expand Down
4 changes: 3 additions & 1 deletion packages/pods-core/src/builtin/__tests__/JSONPod.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ describe("JSONImportPod", () => {
});
expect(importedNote).toMatchSnapshot();
expect(
_.every(["bar body", "foo body"], (ent) => importedNote.match(ent))
_.every(["[[bar]]", "bar body", "foo body"], (ent) =>
importedNote.match(ent)
)
).toBeTruthy();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ dest: TODO"

exports[`JSONImportPod concatenate 1`] = `
"---
id: 0ab9bfb2-bc89-4995-a06f-50efe9446ddf
id: ad9f3347-7adf-49b0-97e8-acede4b93c5a
title: Results
desc: ''
updated: 1600024232131
created: 1600024232131
updated: 1600110905047
created: 1600110905047
stub: false
---
# foo
# [[foo]]
foo body
---
# bar
# [[bar]]
bar body
---
"
Expand Down

0 comments on commit 8113594

Please sign in to comment.