Skip to content

Commit

Permalink
Revert c5a32c7
Browse files Browse the repository at this point in the history
PR #3648 was merged without noticing it was targeting the wrong branch.
  • Loading branch information
jasonvarga committed May 5, 2021
1 parent c5a32c7 commit c0cd90f
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/Fieldtypes/Bard/Augmentor.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class Augmentor

protected static $customMarks = [];
protected static $customNodes = [];
protected static $replaceMarks = [];
protected static $replaceNodes = [];

public function __construct($fieldtype)
{
Expand Down Expand Up @@ -94,21 +92,12 @@ protected function addSetIndexes($value)

public function convertToHtml($value)
{
$renderer = (new Renderer)
return (new Renderer)
->replaceNode(DefaultImageNode::class, CustomImageNode::class)
->addNode(SetNode::class)
->addNodes(static::$customNodes)
->addMarks(static::$customMarks);

foreach (static::$replaceNodes as $searchNode => $replaceNode) {
$renderer->replaceNode($searchNode, $replaceNode);
}

foreach (static::$replaceMarks as $searchMark => $replaceMark) {
$renderer->replaceMark($searchMark, $replaceMark);
}

return $renderer->render(['type' => 'doc', 'content' => $value]);
->addMarks(static::$customMarks)
->render(['type' => 'doc', 'content' => $value]);
}

public static function addNode($node)
Expand All @@ -121,16 +110,6 @@ public static function addMark($mark)
static::$customMarks[] = $mark;
}

public static function replaceNode($searchNode, $replaceNode)
{
static::$replaceNodes[$searchNode] = $replaceNode;
}

public static function replaceMark($searchMark, $replaceMark)
{
static::$replaceMarks[$searchMark] = $replaceMark;
}

protected function convertToSets($html)
{
$arr = preg_split('/(<set>index-\d+<\/set>)/', $html, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
Expand Down

0 comments on commit c0cd90f

Please sign in to comment.