From 43bc3b8515c9a73c15960f2869a1d79b623dd89d Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sun, 22 Jun 2025 22:51:09 +0100 Subject: [PATCH] fix: Markdown sanitization --- .../infolists/src/Components/Concerns/CanFormatState.php | 8 ++++---- packages/tables/src/Columns/Concerns/CanFormatState.php | 8 ++++---- .../src/Columns/Summarizers/Concerns/CanFormatState.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/infolists/src/Components/Concerns/CanFormatState.php b/packages/infolists/src/Components/Concerns/CanFormatState.php index aef3cf13a1..987e5bc6e0 100644 --- a/packages/infolists/src/Components/Concerns/CanFormatState.php +++ b/packages/infolists/src/Components/Concerns/CanFormatState.php @@ -283,6 +283,10 @@ trait CanFormatState ]); if ($isHtml) { + if ($this->isMarkdown()) { + $state = Str::markdown($state); + } + $state = Str::sanitizeHtml($state); } @@ -303,10 +307,6 @@ trait CanFormatState $state = Str::words($state, $wordLimit, $this->getWordLimitEnd()); } - if ($isHtml && $this->isMarkdown()) { - $state = Str::markdown($state); - } - $prefix = $this->getPrefix(); $suffix = $this->getSuffix(); diff --git a/packages/tables/src/Columns/Concerns/CanFormatState.php b/packages/tables/src/Columns/Concerns/CanFormatState.php index f03a7b434c..8821d562de 100644 --- a/packages/tables/src/Columns/Concerns/CanFormatState.php +++ b/packages/tables/src/Columns/Concerns/CanFormatState.php @@ -283,6 +283,10 @@ trait CanFormatState ]); if ($isHtml) { + if ($this->isMarkdown()) { + $state = Str::markdown($state); + } + $state = Str::sanitizeHtml($state); } @@ -303,10 +307,6 @@ trait CanFormatState $state = Str::words($state, $wordLimit, $this->getWordLimitEnd()); } - if ($isHtml && $this->isMarkdown()) { - $state = Str::markdown($state); - } - $prefix = $this->getPrefix(); $suffix = $this->getSuffix(); diff --git a/packages/tables/src/Columns/Summarizers/Concerns/CanFormatState.php b/packages/tables/src/Columns/Summarizers/Concerns/CanFormatState.php index fc6ad22c23..1929b7c90e 100644 --- a/packages/tables/src/Columns/Summarizers/Concerns/CanFormatState.php +++ b/packages/tables/src/Columns/Summarizers/Concerns/CanFormatState.php @@ -148,6 +148,10 @@ trait CanFormatState ]); if ($isHtml) { + if ($this->isMarkdown()) { + $state = Str::markdown($state); + } + $state = Str::sanitizeHtml($state); } @@ -156,10 +160,6 @@ trait CanFormatState $state = $state->toHtml(); } - if ($isHtml && $this->isMarkdown()) { - $state = Str::markdown($state); - } - $prefix = $this->getPrefix(); $suffix = $this->getSuffix();