36 private $quote =
false;
44 foreach ($node->attributes() as $attribute) {
46 $name = (string) $attribute->getName();
47 $value = (string) $attribute;
51 $this->prefix = $value;
54 $this->suffix = $value;
57 $this->quote = (bool) $attribute;
68 $prefix = $this->prefix;
69 $suffix = $this->suffix;
71 if (!empty($suffix)) {
72 $no_tags = strip_tags($text);
73 if (strlen($no_tags) && ($no_tags[(strlen($no_tags) - 1)] == $suffix[0])) {
74 $suffix = substr($suffix, 1);
80 ->filter(
'options',
'punctuation-in-quote');
81 $punctuationInQuote = is_array($piq) ? current($piq) : $piq;
83 if ($punctuationInQuote && in_array($suffix, [
',',
';',
'.'])) {
85 $lastChar = mb_substr($text, -1, 1);
86 if ($closeQuote === $lastChar) {
87 $text = mb_substr($text, 0, mb_strlen($text) - 1);
88 return $text . $suffix . $lastChar;
93 return $prefix . $text . $suffix;
101 return $this->prefix;
109 return $this->suffix;