[GH-ISSUE #4101] Fix the built-in Clean HTML outgoing prompt regex #2221

Closed
opened 2026-10-21 05:46:23 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Jul 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4101

Originally assigned to: @SpicyMarinara on GitHub.

Problem

The built-in Clean HTML (Outgoing Prompt) regex is rejected by Marinara's regex safety guard:

Regex pattern is unsafe: avoid nested quantifiers, ambiguous quantified alternatives, and oversized patterns.

Its quoted-attribute alternatives contain unbounded repeats inside an outer repeated group. The script is therefore skipped at runtime and cannot be saved through the editor.

This leaves HTML and speaker wrappers in outgoing prompt history used by Immersive HTML, group Roleplay, and Agent workflows.

Required fix

  • Replace the built-in pattern with a validator-safe equivalent that removes ordinary HTML/XML-style and <speaker> tags.
  • Preserve the intentionally excluded font, lie, filter, and HTML comment tags.
  • Migrate existing installations only when the built-in row still contains the exact broken legacy pattern, preserving user edits.
  • Add regression coverage for safety validation, Immersive HTML markup, speaker tags, exclusions, and migration behavior.

Coordination

Implementation owner: @SpicyMarinara

Originally created by @SpicyMarinara on GitHub (Jul 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4101 Originally assigned to: @SpicyMarinara on GitHub. ## Problem The built-in **Clean HTML (Outgoing Prompt)** regex is rejected by Marinara's regex safety guard: > Regex pattern is unsafe: avoid nested quantifiers, ambiguous quantified alternatives, and oversized patterns. Its quoted-attribute alternatives contain unbounded repeats inside an outer repeated group. The script is therefore skipped at runtime and cannot be saved through the editor. This leaves HTML and speaker wrappers in outgoing prompt history used by Immersive HTML, group Roleplay, and Agent workflows. ## Required fix - Replace the built-in pattern with a validator-safe equivalent that removes ordinary HTML/XML-style and `<speaker>` tags. - Preserve the intentionally excluded `font`, `lie`, `filter`, and HTML comment tags. - Migrate existing installations only when the built-in row still contains the exact broken legacy pattern, preserving user edits. - Add regression coverage for safety validation, Immersive HTML markup, speaker tags, exclusions, and migration behavior. ## Coordination Implementation owner: @SpicyMarinara
bsakaguchi 2026-10-21 05:46:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2221
No description provided.