Skip to content

dndbeyond: Unicode characters on monster pages #1379

@dmportella

Description

@dmportella

Describe the bug
When rolling a monster ability check, saving throw, or skill check that has a negative modifier (e.g., Strength −2), the result is calculated as if the modifier was positive. The roll result shows a value that is too high by double the modifier amount.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a monster page on D&D Beyond that has negative ability/save modifiers (e.g., Wraith, Shadow, or any monster with a negative stat)
  2. Click on the roll button for an ability with a negative modifier (e.g., Strength which shows "−2")
  3. Check the roll result sent to the VTT or shown in the roll dialog
  4. The result is calculated as 1d20 + 2 instead of 1d20 − 2

Expected behavior
Rolling a monster ability/save/skill with a negative modifier should correctly subtract that value from the d20 roll. For a Wraith's Strength (−2), rolling should produce results in the range of −1 to 18 (1d20−2), not 3 to 22 (1d20+2).

Screenshots
To help explain your problem, add screenshots of:

  • The monster stat block showing the negative modifier (e.g., STR −2)
  • The Beyond20 roll result showing an incorrectly high total
  • The sent request JSON showing "roll": "1d20−2" with Unicode minus

Browser Info (please complete the following information):

  • Browser: Chrome/Firefox/Edge (any)
  • Version: any
  • If applicable, any dev console errors: None - the roll appears to succeed but with incorrect math

Additional context

  • The issue affects all monster rolls: ability checks, saving throws, skill checks, and initiative
  • The root cause is that D&D Beyond uses Unicode minus sign (U+2212, ) for negative modifiers, but the extension's formula parser only recognizes ASCII hyphen-minus (U+002D, -)
  • Example: Wraith monster page - https://www.dndbeyond.com/monsters/wraith (STR −2, Save STR −2)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions