v14 fixes again
All checks were successful
Release Creation / build (release) Successful in 49s

This commit is contained in:
2026-04-24 22:27:58 +02:00
parent c61179a790
commit 6f8b165745
49 changed files with 77 additions and 67 deletions

View File

@@ -131,10 +131,12 @@ Hooks.once("ready", function () {
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
// In Foundry v14+, ProseMirror wraps message in <p>...</p> — strip it like ChatLog.parse does
const stripped = content.replace(/^<p>|<\/p>$/gi, "").trim();
if (stripped[0] === '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.malefices.commands.processChatCommand(commands, content, msg)) {
let commands = stripped.match(regExp);
if (game.system.malefices.commands.processChatCommand(commands, stripped, msg)) {
return false;
}
}