diff --git a/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs index 2831237bc55..34616743db0 100644 --- a/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs +++ b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs @@ -4,18 +4,25 @@ {{/if}} +{{!-- + The `~` syntax strip spaces between the elements, making it produce + `Some text`, + with no space between them. + This causes the topic-post-badge to be considered the same word as "text" + at the end of the link, preventing it from line wrapping onto its own line. +--}} - {{raw-plugin-outlet name="topic-list-before-status"}} - {{raw "topic-status" topic=topic}} - {{topic-link topic class="raw-link raw-topic-link"}} - {{#if topic.featured_link}} - {{topic-featured-link topic}} - {{/if}} - {{raw-plugin-outlet name="topic-list-after-title"}} - {{#if showTopicPostBadges}} - {{raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}} - {{/if}} + {{~raw-plugin-outlet name="topic-list-before-status"}} + {{~raw "topic-status" topic=topic}} + {{~topic-link topic class="raw-link raw-topic-link"}} + {{~#if topic.featured_link}} + {{~topic-featured-link topic}} + {{~/if}} + {{~raw-plugin-outlet name="topic-list-after-title"}} + {{~#if showTopicPostBadges}} + {{~raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}} + {{~/if}} {{discourse-tags topic mode="list" tagsForUser=tagsForUser}} diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scss index 552e6f8e636..ed75cf3b583 100644 --- a/app/assets/stylesheets/common/base/_topic-list.scss +++ b/app/assets/stylesheets/common/base/_topic-list.scss @@ -297,3 +297,16 @@ div.education { @extend .list-cell; border-bottom: 2px solid $primary-low; } + +// This is not what we want: +// +// This is an overly-long topic title that would break just right +// * +// +// Instead, we want the line to break like this: +// +// This is an overly-long topic title that would break just +// right * +.topic-post-badges { + white-space: nowrap; +} \ No newline at end of file