mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 02:54:41 +08:00
FIX: correctly display escaped thread titles (#24159)
Prior to this fix, titles with a quote `'` for example, would be rendered as: `'`
This commit is contained in:
@ -15,8 +15,8 @@
|
||||
>
|
||||
<div class="chat-thread-list-item__header">
|
||||
<div class="chat-thread-list-item__title">
|
||||
{{#if this.title}}
|
||||
{{replace-emoji this.title}}
|
||||
{{#if @thread.title}}
|
||||
{{replace-emoji @thread.title}}
|
||||
{{else}}
|
||||
{{replace-emoji @thread.originalMessage.excerpt}}
|
||||
{{/if}}
|
||||
|
@ -5,10 +5,6 @@ import { inject as service } from "@ember/service";
|
||||
export default class ChatThreadListItem extends Component {
|
||||
@service router;
|
||||
|
||||
get title() {
|
||||
return this.args.thread.escapedTitle;
|
||||
}
|
||||
|
||||
@action
|
||||
openThread(thread) {
|
||||
this.router.transitionTo("chat.channel.thread", ...thread.routeModels);
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
|
||||
<span class="chat-thread-header__label overflow-ellipsis">
|
||||
{{replace-emoji this.label}}
|
||||
{{replace-emoji @thread.title}}
|
||||
</span>
|
||||
|
||||
<div
|
||||
|
@ -36,10 +36,6 @@ export default class ChatThreadHeader extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
get label() {
|
||||
return this.args.thread.escapedTitle;
|
||||
}
|
||||
|
||||
get canChangeThreadSettings() {
|
||||
if (!this.args.thread) {
|
||||
return false;
|
||||
|
@ -127,6 +127,7 @@ function threadFabricator(args = {}) {
|
||||
const channel = args.channel || channelFabricator();
|
||||
return ChatThread.create(channel, {
|
||||
id: args.id || sequence++,
|
||||
title: args.title,
|
||||
original_message: args.original_message || messageFabricator({ channel }),
|
||||
preview: args.preview || threadPreviewFabricator({ channel }),
|
||||
});
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import guid from "pretty-text/guid";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import { getOwnerWithFallback } from "discourse-common/lib/get-owner";
|
||||
import ChatMessagesManager from "discourse/plugins/chat/discourse/lib/chat-messages-manager";
|
||||
import ChatMessage from "discourse/plugins/chat/discourse/models/chat-message";
|
||||
@ -73,8 +72,4 @@ export default class ChatThread {
|
||||
get routeModels() {
|
||||
return [...this.channel.routeModels, this.id];
|
||||
}
|
||||
|
||||
get escapedTitle() {
|
||||
return escapeExpression(this.title);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user