Skip to content

Commit

Permalink
[5.x] Fix entry links when Bard value is HTML (#11192)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Dec 2, 2024
1 parent 3f8db0b commit b114722
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Fieldtypes/Bard.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function preProcess($value)
}

if (is_string($value)) {
$value = str_replace('statamic://', '', $value);
$value = str_replace('src="statamic://', 'src="', $value);
$doc = (new Augmentor($this))->renderHtmlToProsemirror($value);
$value = $doc['content'];
} elseif ($this->isLegacyData($value)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Fieldtypes/BardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function it_converts_plain_html_into_prosemirror_structure()
'content' => [
['type' => 'text', 'text' => 'Second '],
['type' => 'text', 'text' => 'paragraph', 'marks' => [
['type' => 'link', 'attrs' => ['href' => 'entry::foo']],
['type' => 'link', 'attrs' => ['href' => 'statamic://entry::foo']],
]],
['type' => 'text', 'text' => '. '],
['type' => 'image', 'attrs' => [
Expand Down

0 comments on commit b114722

Please sign in to comment.