-
-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Check for existing bug reports before submitting.
- I searched for existing Bug Reports and found no similar reports.
Expected Behavior
When using template monsters, the commas should be ommited if there are empty fields. For example,
source: 5e SRD
size: Small
type: beast
subtype: "" <--- this should not be rendered in the list, and should be ommited
alignment: unaligned
... omitted the rest of the code as it does not pertain to the issue
This should have rendered like the example in the Bestiary page. Like below,

However, it does not, at least I cannot figure out if their is a custom command I need to put in order to omit these commas.
Current behaviour
Empty fields result in extra commas in monster statblocks, example below when viewing "Octopus".

In bestiary section of the website, the documentation points out that the octopus will look like this,

However, when using the plugin, it does not.
Reproduction
There are two ways you can reproduce this,
- Go to the Plugin settings and view any monster that has a missing field, in my example I used Octopus. You can view what this will look like and see the extra commas.
- Import the preset monster in a note through the presented documentation in the Bestiary site. Example below,


Which Operating Systems are you using?
- Android
- iPhone/iPad
- Linux
- macOS
- Windows
Obsidian Version Check
1.8.10
Plugin Version
4.9.1
Confirmation
- I have disabled all other plugins and the issue still persists.
Possible solution
I am not sure what under the hood looks like for this yet. Or if maybe I am just having a weird quirk. But I think you could do something like this,
let properties = [monster.size, monster.type, monster.alignment];
let filtered = properties.filter(prop => prop && prop.trim() !== "");
let output = filtered.join(", ");
Where you can filter out empty or whitespace only properties before joining them.