public function PreparedTagElement::getOuterSource in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x src/PreparedTagElement.php \Drupal\xbbcode\PreparedTagElement::getOuterSource()
Retrieve the content including the opening and closing tags.
Tags inside the content will still be rendered.
Return value
string|mixed The tag source.
Overrides TagElementInterface::getOuterSource
File
- src/
PreparedTagElement.php, line 129
Class
- PreparedTagElement
- Adapter for the tag element that marks markup as safe.
Namespace
Drupal\xbbcodeCode
public function getOuterSource() {
// Reconstruct the opening and closing tags, but render the content.
if (!isset($this->outerSource)) {
$name = $this->tag
->getName();
// The argument string must be made safe before rendering.
$argument = XssEscape::filterAdmin($this->tag
->getArgument());
$content = $this->tag
->getContent();
$this->outerSource = Markup::create("[{$name}{$argument}]{$content}[/{$name}]");
}
return $this->outerSource;
}