javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
353 stars 71 forks source link

🐞 Adding name to statblock css classes doesn't work for non-Latin letters #338

Closed silentjames closed 8 months ago

silentjames commented 8 months ago

Check for existing bug reports before submitting.

Expected Behavior

I suppose, when nothing but hyphens are left for class name, it better to remove this "name" completely.

Current behaviour

As I noticed recently, a name from a statblock is added to statblock's css classes. However, if non-Latin letters are used, they will be excluded. For example, for the name Дракон Tláloc I'll get -tlloc as class name. More over, if there are only non-Latin letters and even a few words, there is almost nothing in css classes, only hyphens. I mean, Дракон Тлалок transforms into -, that's all.

image

Reproduction

  1. Launch Obsidian in Sandbox Vault
  2. Install Fantasy Statblocks
  3. Create a layout with the name Дракон Тлалок
  4. Open developer tools to see what's was added to css class list as the name
```statblock
layout: Basic 5e Layout
name: Дракон Тлалок
size: Gargantuan
type: dragon
subtype:
alignment: chaotic evil


### Which Operating Systems are you using?

- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [X] macOS
- [ ] Windows

### Obsidian Version Check

1.5.3

### Plugin Version

v3.16.3

### Confirmation

- [X] I have disabled all other plugins and the issue still persists.

### Possible solution

_No response_