Skip to content

Commit 7ec749b

Browse files
vadi2claudeZookaOnGit
authored
Fix MXP parser to display invalid tags instead of eating them (#8467)
<!-- Keep the title short & concise so anyone non-technical can understand it, the title appears in PTB changelogs --> #### Brief overview of PR changes/additions When the MXP parser encounters text inside angle brackets that cannot be parsed as valid MXP (and is not a custom element), it now displays the content as-is instead of silently removing it. #### Motivation for adding to Mudlet Better handle scenarios where games that do not negotiate MXP still send it, or when players force-enable MXP on Mudlet's side when the game isn't sending MXP to begin with. #### Other info (issues closed, discussion etc) Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Zooka <136661366+ZookaOnGit@users.noreply.github.com>
1 parent b061a8c commit 7ec749b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/TMxpProcessor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ TMxpProcessingResult TMxpProcessor::processMxpInput(char& ch, bool resolveCustom
172172
}
173173

174174
TMxpTagHandlerResult const result = mMxpTagProcessor.handleTag(mMxpTagProcessor, *mpMxpClient, tag.get());
175+
176+
// If tag was not handled (not valid MXP and not a custom element), display it as-is
177+
if (result == MXP_TAG_NOT_HANDLED) {
178+
lastEntityValue = tag->toString();
179+
return HANDLER_INSERT_ENTITY_LIT;
180+
}
181+
175182
return result == MXP_TAG_COMMIT_LINE ? HANDLER_COMMIT_LINE : HANDLER_NEXT_CHAR;
176183
}
177184

0 commit comments

Comments
 (0)