[Fix] Enricher fixes for [[fr]] and reaction argument lazy fix (#1586)

* Update utils.mjs

* fixed reaction situation.

* Made change in enricher instead of dialog

* comment clarity
This commit is contained in:
Nikhil Nagarajan 2026-01-27 11:56:42 -05:00 committed by GitHub
parent bae9470a4f
commit 6321c7c508
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -90,11 +90,12 @@ export const enrichedDualityRoll = async (
event: event ?? {}, event: event ?? {},
title: title, title: title,
headerTitle: label, headerTitle: label,
actionType: reaction ? 'reaction' : null,
roll: { roll: {
trait: traitValue && target ? traitValue : null, trait: traitValue && target ? traitValue : null,
difficulty: difficulty, difficulty: difficulty,
advantage, advantage,
type: reaction ? 'reaction' : null // type: reaction ? 'reaction' : null //not needed really but keeping it for troubleshooting
}, },
skips: { skips: {
resources: !grantResources, resources: !grantResources,

View file

@ -12,7 +12,7 @@ export function rollCommandToJSON(text) {
const flavor = flavorMatch ? flavorMatch[1] : null; const flavor = flavorMatch ? flavorMatch[1] : null;
// Match key="quoted string" OR key=unquotedValue // Match key="quoted string" OR key=unquotedValue
const PAIR_RE = /(\w+)=("(?:[^"\\]|\\.)*"|\S+)/g; const PAIR_RE = /(\w+)\s*=\s*("(?:[^"\\]|\\.)*"|[^\]\}\s]+)/g; //updated regex to allow escaped quotes in quoted strings and avoid matching closing brackets/braces
const result = {}; const result = {};
for (const [, key, raw] of text.matchAll(PAIR_RE)) { for (const [, key, raw] of text.matchAll(PAIR_RE)) {
let value; let value;