fix: #3177428 Keep HTML out of the translatable filter description

Issue: https://www.drupal.org/project/ace_editor/issues/3177428

The filter description mixed both conventions: two occurrences of the tag were HTML entities, a third was raw. Rather than encoding the third one, the HTML is now out of the translatable string entirely - the tags arrive as placeholder values:

description = @Translation("Use @open and @close tags to show it with syntax highlighting. Add attributes to the @open tag to control formatting, see the module's documentation for examples.", arguments = {"@open" = "<ace>", "@close" = "</ace>"}),

The source string now carries no HTML and no entities, which is what the translation import pipeline needs: a source string containing unallowed HTML is rejected, so the string is skipped and its translations are silently dropped. Drupal escapes the placeholder values when the string is rendered, so the settings page still shows the tags as readable text.

Same class of defect fixed next door in AceEditorHooks::help(): t('<li>node edit forms, including summary</li>') and t('<li>blocks edit forms</li>') put markup inside translatable strings and built two malformed single-item lists. The markup moved outside t() and the two lists became one well-formed list.

Also corrected the reference to README.txt, which the repository does not have (it ships README.md and docs/).

Tests: AceFilterUiTextTest - the rendered description shows both tags; the source string carries no HTML and no entities (asserted through getUntranslatedString(), which is what the translation pipeline reads); the description survives Xss::filterAdmin() unchanged; no filter user interface string carries a raw tag; and the help text renders one well-formed list.

Rebased onto the merged hook conversion (!27 (merged)), so the help change lands in the hook class.

Verified locally: kernel+unit suite green, PHPStan clean, PHPCS clean.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading
Loading