Skip to content

[3.1.1] HTML/XML tags are getting stripped from prompt #6047

@marcopixel

Description

@marcopixel

Describe the bug

When saving a prompt that contains structured tags (e.g. <instructions>, <context>), the editor removes these tags, resulting in a flattened, unstructured prompt. This happens either in Rich-Text editor mode and Source editor mode. This is probably a side effect of the new editor implemented at #5988, reverting back to 3.1.0 fixed the issue for me.

This is problematic because major LLM providers explicitly recommend structured prompting with XML-style tags. Removing them breaks the intended structure, reduces model reliability, and undermines best practices for clear instruction separation and predictable outputs.

Guidelines:

To Reproduce

  1. Open Agentflow V2
  2. Create a new LLM/Agent node
  3. Open any prompt input
  4. Enter the following text:
<question>
{{question}}
</question>
<current_date_time>
{{current_date_time}}
</current_date_time>
  1. Save and reopen

Expected behavior

The tags should be retained in the prompt output and not being removed.

Screenshots

Before saving:
Image

After saving:
Image

Flow

No response

Use Method

Docker

Flowise Version

3.1.1

Operating System

Linux

Browser

Chrome

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions