From 9ba985a68827c2cbc2d82a075f67584842512926 Mon Sep 17 00:00:00 2001 From: Andrey Azarko Date: Sun, 17 Jun 2018 01:06:18 +0300 Subject: [PATCH] fix #2713 --- protected/humhub/widgets/views/richTextEditor.php | 8 ++++++++ static/js/humhub/humhub.ui.richtext.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/protected/humhub/widgets/views/richTextEditor.php b/protected/humhub/widgets/views/richTextEditor.php index 0cfaf2135c..553c062e10 100644 --- a/protected/humhub/widgets/views/richTextEditor.php +++ b/protected/humhub/widgets/views/richTextEditor.php @@ -74,6 +74,14 @@ use yii\helpers\Url; // reset query count query.length = 0; } + }, + beforeInsert: function(value, $li) { + if ($li.data('item-data').link == undefined) { + return ""; + } + else { + return value; + } } } }).atwho({ diff --git a/static/js/humhub/humhub.ui.richtext.js b/static/js/humhub/humhub.ui.richtext.js index bfb59650ac..91a5c40372 100644 --- a/static/js/humhub/humhub.ui.richtext.js +++ b/static/js/humhub/humhub.ui.richtext.js @@ -437,6 +437,14 @@ humhub.module('ui.richtext', function(module, require, $) { // reset query count query.length = 0; } + }, + beforeInsert: function(value, $li) { + if ($li.data('item-data').link == undefined) { + return ""; + } + else { + return value; + } } } };