Skip to content

Fix #220: Allow new line (\n) in rules - #582

Merged
GermanBluefox merged 1 commit into
masterfrom
fix/issue-220-mwkeprl0
Nov 21, 2026
Merged

GermanBluefox merged 1 commit into
masterfrom
fix/issue-220-mwkeprl0

Conversation

@GermanBluefox

Copy link
Copy Markdown
Contributor

A literal \n (backslash followed by n) in the acknowledge/answer text of a rule is now converted to a real line break, so multi-line answers are possible, e.g. for Telegram. The conversion happens once in getRandomPhrase() after one of the /-separated alternatives is chosen, so random alternatives keep working. Placeholders like %s and %u are filled in afterwards, so state values that contain a literal \n are not changed. A unit test for getRandomPhrase() was added, and the README now documents the new option and has a changelog entry. Fixes #220.

Fixes #220

A literal `\n` (backslash followed by `n`) in the acknowledge/answer text of a rule is now converted to a real line break, so multi-line answers are possible, e.g. for Telegram. The conversion happens once in `getRandomPhrase()` after one of the `/`-separated alternatives is chosen, so random alternatives keep working. Placeholders like `%s` and `%u` are filled in afterwards, so state values that contain a literal `\n` are not changed. A unit test for `getRandomPhrase()` was added, and the README now documents the new option and has a changelog entry. Fixes #220.

Fixes #220
@GermanBluefox
GermanBluefox merged commit fe180cd into master Nov 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow new line (\n) in rules

1 participant