Abbreviation UTF8
crossrw opened this issue · comments
Alexey Lutovinin commented
Abbreviation does not work for multi-byte encoding.
Example:
*[АБВГ]: This Cyrillic alphabet
For solve need add "u" modifier to pattern at unmarkedText($text) function :
protected function unmarkedText($text)
{
$text = parent::unmarkedText($text);
if (isset($this->DefinitionData['Abbreviation']))
{
foreach ($this->DefinitionData['Abbreviation'] as $abbreviation => $meaning)
{
$pattern = '/\b'.preg_quote($abbreviation, '/').'\b/u'; // add "u"
$text = preg_replace($pattern, '<abbr title="'.$meaning.'">'.$abbreviation.'</abbr>', $text);
}
}
return $text;
}