This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user