Replace German quotation marks (โ€ž โ€ฆ โ€œ) with smartypants?

SmartyPants only replaces plain ASCII quotes to the configured format, but it cannot detect other types of quotes.

A workaround could be to first dynamically replace the German quotation marks to ASCII ones and then call SmartyPants afterwards:

$someText_withGuillemets = $page->someText()->callback(function ($field) {
  $field->value = str_replace(['โ€ž', 'โ€œ'], '"', $field->value);
  return $field;  
})->kirbyText()->smartypants();
3 Likes