mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Enh: Added humhub\modules\content\widgets\richtext\ProsemirrorRichText::parseOutput
for pre render parsing
This commit is contained in:
parent
bc37921e7e
commit
11cc627704
@ -53,6 +53,8 @@ use yii\base\InvalidArgumentException;
|
||||
*/
|
||||
abstract class AbstractRichText extends JsWidget
|
||||
{
|
||||
const PRESET_DOCUMENT = 'document';
|
||||
|
||||
/**
|
||||
* @event Event an event raised after the post-process phase of the rich text.
|
||||
*/
|
||||
|
@ -154,7 +154,7 @@ class ProsemirrorRichText extends AbstractRichText
|
||||
}
|
||||
}
|
||||
|
||||
$this->text = static::parseMentionings($this->text, $this->edit);
|
||||
$this->text = $this->parseOutput();
|
||||
|
||||
if ($this->maxLength > 0) {
|
||||
$this->text = Helpers::truncateText($this->text, $this->maxLength);
|
||||
@ -168,6 +168,14 @@ class ProsemirrorRichText extends AbstractRichText
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @since v1.3.2
|
||||
*/
|
||||
protected function parseOutput()
|
||||
{
|
||||
return static::parseMentionings($this->text, $this->edit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string truncated and stripped text
|
||||
*/
|
||||
@ -215,9 +223,13 @@ class ProsemirrorRichText extends AbstractRichText
|
||||
return $container->isActive()
|
||||
? '['.Html::encode($container->getDisplayName()).'](mention:'.$container->guid.' "'.$container->getUrl().'")'
|
||||
: $notFoundResult;
|
||||
} elseif($container instanceof Space) {
|
||||
}
|
||||
|
||||
if($container instanceof Space) {
|
||||
return '['.Html::encode($container->name).'](mention:'.$container->guid.' "'.$container->getUrl().'")';
|
||||
}
|
||||
|
||||
return '';
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user