Opened 4 years ago

Closed 4 years ago

#16071 closed Cleanup/optimization (fixed)

Update fix_ampersands documentation for behavior with existing entities

Reported by: Jerry Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords: fix_ampersands filters
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

fix_ampersands doesn’t replace all ampersands with & entities; it attempts, usually successfully, to exclude named entities and numeric character references while converting all ampersands that do need replacing. This (and its behavior in some edge cases, noted at ticket:16066) should be documented.

Adds two lines under fix_ampersands in docs/_build/html/ref/templates/builtins.html:

Named entities and numeric character references are not replaced. If ``value``
is ``Pepé Le Pew``, the output will remain ``Pepé Le Pew``.

In some edge cases--such as abbreviations followed by semicolons--this filter
will not replace ampersands that need replacing. If ``value`` is ``Darrin, run
that past R&D; Betty…``, the output will remain unchanged because ``&D;``
resembles a named entity.

Attachments (3)

documentation.diff (792 bytes) - added by jerry 4 years ago.
updates fix_ampersands documentation to note its behavior when entities or entity-like characters already exist in the text.
16071.fixampersands-doc.diff (829 bytes) - added by julien 4 years ago.
16071.fixampersands-doc.2.diff (838 bytes) - added by julien 4 years ago.
Fixed typo

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by jerry

updates fix_ampersands documentation to note its behavior when entities or entity-like characters already exist in the text.

comment:1 Changed 4 years ago by d0ugal

  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by d0ugal

  • Type changed from Uncategorized to Cleanup/optimization

Changed 4 years ago by julien

comment:3 Changed 4 years ago by julien

  • Triage Stage changed from Accepted to Ready for checkin
  • UI/UX unset

Thanks, this is good to go. I've just made some minor edits.

Changed 4 years ago by julien

Fixed typo

comment:4 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

In [16431]:

Fixed #16071 -- Added note to fix_ampersands documentation about its limitations. Many thanks to jerry and Julien Phalip.

Note: See TracTickets for help on using tickets.
Back to Top