Opened 5 years ago

Closed 5 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 5 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 Phalip 5 years ago.
16071.fixampersands-doc.2.diff (838 bytes) - added by Julien Phalip 5 years ago.
Fixed typo

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by jerry

Attachment: documentation.diff added

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

comment:1 Changed 5 years ago by Dougal Matthews

Easy pickings: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:2 Changed 5 years ago by Dougal Matthews

Type: UncategorizedCleanup/optimization

Changed 5 years ago by Julien Phalip

comment:3 Changed 5 years ago by Julien Phalip

Triage Stage: AcceptedReady for checkin
UI/UX: unset

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

Changed 5 years ago by Julien Phalip

Fixed typo

comment:4 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

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