Skip to content

Add MultilineTextField formatting tests and escape block quote markers - #483

Open
nayij wants to merge 2 commits into
mainfrom
fix/DF-1535-multiline-blockquote-500
Open

nayij wants to merge 2 commits into
mainfrom
fix/DF-1535-multiline-blockquote-500

Conversation

@nayij

@nayij nayij commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Proposed change

A multiline answer with lines starting with > (e.g. > first / > / > second) caused a 500 on Check your answers. escapeMarkdown didn't escape >, so the answer was read as a quote, and marked threw on the blank line inside it (Token with "space" type was not found). This escapes > so the answer shows as typed, on the summary page and in GOV.UK Notify emails.

Jira ticket: DF-1535

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

@nayij
nayij marked this pull request as draft October 21, 2026 14:08
@nayij
nayij marked this pull request as ready for review October 21, 2026 14:45
@sonarqubecloud

Copy link
Copy Markdown

@Scullyon Scullyon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Might be worthwhile adding in an explicit test for escapeMarkdown that's in the file src/server/plugins/engine/components/helpers/index.ts

This branch has not been deployed

No deployments
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.

2 participants