Skip to content

Commit

Permalink
fix: Fixes issue where non-string properties would try to replace links
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed May 3, 2024
1 parent de5b6bf commit 0ee0330
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/view/ui/MarkdownHolder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
import type { Writable } from "svelte/store";
export let property: string;
property = Linkifier.stringifyLinks(property);
property =
typeof property === "string"
? Linkifier.stringifyLinks(property)
: property;
const context = getContext<string>("context");
const renderer = getContext<StatBlockRenderer>("renderer");
let item = getContext<MarkdownableItem>("item");
let canDice = getContext<boolean>("dice");
let parseDice = item.dice;
const monsterStore = getContext<Writable<Monster>>("monster");
let monster = $monsterStore;
Expand Down Expand Up @@ -64,8 +69,9 @@
}
property = "";
for (const dice of split) {
if (typeof dice != "string") {
if (canDice && typeof dice != "string") {
let diceString;
let diceText = plugin.getRollerString(dice.text);
if (dice.original) {
Expand All @@ -81,7 +87,7 @@
const markdown = (node: HTMLElement) => {
if (property === "-") {
property = "\\-"
property = "\\-";
}
MarkdownRenderer.render(plugin.app, property, node, context, renderer);
};
Expand Down

0 comments on commit 0ee0330

Please sign in to comment.