Skip to content

A platform for community discussion. Free, open, simple.

DEV: htmlSafe timeline topic title (#19320)

Isaac Janzenb46a7b51f7bd
diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs
index 93fce8a0916..b07c1d4807b 100644
--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs
+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs
@@ -1,7 +1,7 @@
{{#if @fullscreen}}
<div class="title">
<h2>
- <a class="fancy-title" href {{on "click" @jumpTop}}>{{if @mobileView @model.fancyTitle ""}}</a>
+ <a class="fancy-title" href {{on "click" @jumpTop}}>{{this.topicTitle}}</a>
</h2>
{{#if (or this.siteSettings.topic_featured_link_enabled this.showTags)}}
<div class="topic-header-extra">
diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js
index 9442219d485..bb522a65061 100644
--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js
+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js
@@ -58,6 +58,10 @@ export default class TopicTimelineScrollArea extends Component {
this.calculatePosition();
}
+ get topicTitle() {
+ return htmlSafe(this.args.mobileView ? this.args.model.fancyTitle : "");
+ }
+
get showTags() {
return (
this.siteSettings.tagging_enabled && this.args.model.tags?.length > 0