diff --git a/src/Tag/ListTag.php b/src/Tag/ListTag.php index f537e8e..5076f51 100644 --- a/src/Tag/ListTag.php +++ b/src/Tag/ListTag.php @@ -22,6 +22,10 @@ public function writeContent(Writer $writer): static { $writer->getSerializer()->writeByte($this->contentTagType); if ($this->isRaw()) { + if($this->rawContentFormat !== $writer->getFormat()) { + throw new Exception("Cannot change format of raw list tag"); + } + $writer->getSerializer()->writeLengthPrefix($this->rawContentLength); $writer->write($this->rawContent); } else {