From 940b91d085e96f801480a433c0f7d7d5c555a246 Mon Sep 17 00:00:00 2001 From: esszett <893278+esszett@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:26:27 +0200 Subject: [PATCH] =?UTF-8?q?Support=20added=20for=20use=20in=20combination?= =?UTF-8?q?=20after=20=E2=80=9CTextformatter=20HTML=20Entity=20Encoder?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a textarea field where the HTML entity encoder is enabled, HannaCode attributes enclosed in quotation marks—such as `test="one two three"`—are truncated because the encoded quotation marks are not recognized. Reversing the order of the TF does not help if HannaCode is supposed to output HTML markup. Suggestion: Add a regex expression for encoded quotation marks. --- TextformatterHannaCode.module | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/TextformatterHannaCode.module b/TextformatterHannaCode.module index 2a49b2e..5bb30cf 100644 --- a/TextformatterHannaCode.module +++ b/TextformatterHannaCode.module @@ -289,7 +289,15 @@ class TextformatterHannaCode extends Textformatter implements ConfigurableModule } foreach($matches[1] as $key => $name) { - $attrs[$name] = trim($matches[2][$key], "'\""); + $value = $matches[2][$key]; + if($matches[3][$key] === '"') { + // Strip " entities used as quote delimiters + if(strpos($value, '"') === 0) $value = substr($value, 6); + if(substr($value, -6) === '"') $value = substr($value, 0, -6); + $attrs[$name] = $value; + } else { + $attrs[$name] = trim($value, "'\""); + } } if(empty($attrs['name'])) {