Using html upcast
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 8 Feb 2024 09:35:39 +0000 (10:35 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 8 Feb 2024 09:35:39 +0000 (10:35 +0100)
files/lib/data/conversation/message/ConversationMessageAction.class.php
templates/conversationMessageInlineEditor.tpl

index 7890b605732d4320f183f3fe6f5e63f71c153652..c28e81e3f3918a7a72ea0ca5c2fb57fbde30efd6 100644 (file)
@@ -20,6 +20,7 @@ use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\flood\FloodControl;
 use wcf\system\html\input\HtmlInputProcessor;
+use wcf\system\html\upcast\HtmlUpcastProcessor;
 use wcf\system\message\censorship\Censorship;
 use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\system\message\QuickReplyManager;
@@ -363,9 +364,16 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
      */
     public function beginEdit()
     {
+        $upcastProcessor = new HtmlUpcastProcessor();
+        $upcastProcessor->process(
+            $this->message->message,
+            'com.woltlab.wcf.conversation.message',
+            $this->message->messageID
+        );
         WCF::getTPL()->assign([
             'defaultSmilies' => SmileyCache::getInstance()->getCategorySmilies(),
             'message' => $this->message,
+            'messageText' => $upcastProcessor->getHtml(),
             'permissionCanUseSmilies' => 'user.message.canUseSmilies',
             'wysiwygSelector' => 'messageEditor' . $this->message->messageID,
         ]);
index e5e9f6a76873fa2bf366c2ddd019458294fc12ed..60575ee4da2144cee05ba35197c80b9a741901a3 100644 (file)
@@ -3,7 +3,7 @@
        <textarea id="{$wysiwygSelector}" class="wysiwygTextarea"
                data-autosave="com.woltlab.wcf.conversation.messageEdit-{$message->messageID}"
                data-support-mention="true"
-       >{$message->message}</textarea>
+       >{$messageText}</textarea>
        {capture assign=wysiwygContainerID}messageEditor{@$message->messageID}{/capture}
        {include file='messageFormTabsInline' inConversationInlineEdit=true wysiwygContainerID=$wysiwygContainerID}