Skip to content

System prompt with single quotes breaks AI Chat page (JavaScript syntax error) #776

@songproducer

Description

@songproducer

Steps to reproduce:

Go to RAGConfig, set the system prompt to any text containing a single quote (e.g. after a 'Additional Information' headline), save,
then open the chat page — it breaks silently

Root cause: yacychat.html embeds the system prompt directly into a JS single-quoted string literal (const SYSTEM_PROMPT = '#[system_prompt]#') without escaping

Fix: Escape the value in yacychat.java before passing it to the template (backslashes, single quotes, and newlines)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions