Skip to content

Instantly share code, notes, and snippets.

@janit
janit / preparerichtext.php
Last active February 6, 2024 11:52
Convert HTML to eZ Platform Rich Text DocBook XML format
<?php
// This is the namespace you want to use
use EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Type as RichTextFieldType;
// this would be a method in your class (you'll need to inject RichTextFieldType)
// It has some extra wrangling of input not required, but makes it moarrr robust
private function prepareRichText($inputText){
if($inputText === ''){