Briefly describe the issue.
TextformatterSmartypants transforms "dumb" typography into "smart" typography, encoded as HTML entities. But it doesn't convert all necessary characters to entities (e.g. >) so it often needs to be used in conjunction with TextformatterEntities. But this results in either:
- the double-encoding of ampersands (Smartypants before Entities)
- or dumb typography (Entities before Smartypants)
What did you expect to happen?
TextformatterSmartypants and TextformatterEntities are able to be used together with normal functionality for each textformatter.
What did actually happen?
- the double-encoding of ampersands (Smartypants before Entities)
- or dumb typography (Entities before Smartypants)
Optional: Do you have screenshots/links that demonstrate the issue?
Bad:

Also bad:

Optional: Have you a suggestion for a possible fix?
The simplest fix would be to decode entities coming from Smartypants. In TextformatterSmartypants.module:
public function format(&$str) {
require_once(dirname(__FILE__) . "/smartypants.php");
// original
// $str = \SmartyPants($str);
// fixed
$str = html_entity_decode(\SmartyPants($str));
}
Alternatively each entity in smartypants.php could be replaced with its UTF-8 equivalent.
What are the steps to reproduce the issue?
- Apply both TextformatterSmartypants and TextformatterEntities to the same field, which contains dumb quotes.
- Check the result of the textformatters on the front-end.
Tell us about the setup you experienced the bug in.
- ProcessWire version: 3.0.35
TextformatterSmartypants transforms "dumb" typography into "smart" typography, encoded as HTML entities. But it doesn't convert all necessary characters to entities (e.g. >) so it often needs to be used in conjunction with TextformatterEntities. But this results in either:
TextformatterSmartypants and TextformatterEntities are able to be used together with normal functionality for each textformatter.
Bad:


Also bad:
The simplest fix would be to decode entities coming from Smartypants. In TextformatterSmartypants.module:
Alternatively each entity in smartypants.php could be replaced with its UTF-8 equivalent.