Skip to content

Commit

Permalink
note parsing beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jan 21, 2022
1 parent da7f93a commit 2ae76a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,15 @@ export default class StatBlockPlugin extends Plugin {
);
additionalParams = cache.frontmatter ?? {};
}

}
const monster: Monster = Object.assign(
{},
this.bestiary.get(params.monster) ??
this.bestiary.get(params.creature),
additionalParams
);
console.log("🚀 ~ file: main.ts ~ line 377 ~ monster", monster.traits);
//TODO: The traits are breaking because it expects { name, desc }, not array.
let traits, actions, legendary_actions, reactions;
if (monster) {
try {
Expand Down
4 changes: 4 additions & 0 deletions src/view/ui/Content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@
}
case "traits": {
const blocks: Trait[] = monster[item.properties[0]] as Trait[];
console.log(
"🚀 ~ file: Content.svelte ~ line 182 ~ blocks",
blocks
);
if (!Array.isArray(blocks) || !blocks.length) return [];
if (item.heading) {
Expand Down
1 change: 1 addition & 0 deletions src/view/ui/Traits.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import TextContentHolder from "./TextContentHolder.svelte";
export let name: string;
console.log("🚀 ~ file: Traits.svelte ~ line 5 ~ name", name);
export let desc: string;
export let render: boolean;
</script>
Expand Down

0 comments on commit 2ae76a4

Please sign in to comment.