Skip to content

Commit

Permalink
feat: Text content is now rendered as markdown by default. The "Rende…
Browse files Browse the repository at this point in the history
…r as Markdown" option has been removed.
  • Loading branch information
valentine195 committed Apr 27, 2024
1 parent 5aaceff commit fb58048
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/settings/layout/blocks/ui/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class MarkdownEnabledModal<
> extends BasicModal<M> {
buildAdvanced(el: HTMLDivElement): void {
super.buildAdvanced(el);
new Setting(el)
/* new Setting(el)
.setName("Render as Markdown")
.setDesc(
createFragment((e) => {
Expand All @@ -667,7 +667,7 @@ class MarkdownEnabledModal<
t.setValue(this.block.markdown).onChange((v) => {
this.block.markdown = v;
});
});
}); */
}
}
class HeadingModal extends BasicModal<HeadingItem> {
Expand Down
6 changes: 1 addition & 5 deletions src/view/ui/ColumnContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@
const component = new SpellItem({
target: createDiv(),
props: {
spell,
render: item.markdown
spell
}
});
targets.push(
Expand Down Expand Up @@ -466,7 +465,6 @@
monster.name
),
property: "trait-subheading",
render: item.markdown,
item,
monster,
trait: monster[item.properties[0]] as Trait
Expand All @@ -485,7 +483,6 @@
name: blocks[0].name,
desc: blocks[0].desc,
property: item.properties[0],
render: item.markdown,
item,
monster,
trait: blocks[0]
Expand All @@ -505,7 +502,6 @@
name: block.name,
desc: block.desc,
property: item.properties[0],
render: item.markdown,
item,
monster,
trait: block
Expand Down
7 changes: 3 additions & 4 deletions src/view/ui/SpellItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
type Spell = { level?: string; spells: string };
export let spell: Spell;
export let render = false;
</script>

<ul class="spell-item">
{#if !spell.level}
<span class="spell-line">
<TextContentHolder {render} property={spell.spells} />
<TextContentHolder property={spell.spells} />
</span>
{:else}
<li class="spell-line">
<span class="spell-level">
<TextContentHolder {render} property={`${spell.level}:`} />
<TextContentHolder property={`${spell.level}:`} />
<!-- {spellItem.split(":").shift()}: -->
</span>
<span class="spells">
<TextContentHolder {render} property={spell.spells} />
<TextContentHolder property={spell.spells} />
<!-- {spellItem.split(":").pop()} -->
</span>
</li>
Expand Down
7 changes: 3 additions & 4 deletions src/view/ui/TextContentHolder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import MarkdownHolder from "./MarkdownHolder.svelte";
export let property: string = "";
export let render: boolean = false;
</script>

{#if render}
<!-- {#if render} -->
<MarkdownHolder {property} />
{:else}
<!-- {:else}
<DiceHolder {property} />
{/if}
{/if} -->
4 changes: 1 addition & 3 deletions src/view/ui/Traits.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
export let name: string;
export let desc: string;
export let property: string = "";
export let render: boolean = false;
export let item: TraitsItem | SpellsItem;
export let monster: Monster;
if (item.callback) {
Expand Down Expand Up @@ -44,15 +43,14 @@
</div>
{/if}

<TextContentHolder {render} property={desc} />
<TextContentHolder property={desc} />
{#if trait?.traits}
<div class="statblock-nested-traits">
{#each trait.traits as nested}
<svelte:self
name={nested.name}
desc={nested.desc}
{property}
{render}
{item}
{nested}
/>
Expand Down

0 comments on commit fb58048

Please sign in to comment.