A platform for community discussion. Free, open, simple.
Prevent badges from becoming typographical widows (#5772)
Michael Howellfe3142e22dfa
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.hbsindex 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 @@</td>{{/if}}+{{!--+ The `~` syntax strip spaces between the elements, making it produce+ `<a class=topic-post-badges>Some text</a><span class=topic-post-badges>`,+ 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.+--}}<td class='main-link clearfix' colspan="{{titleColSpan}}"><span class='link-top-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}}</span>{{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.scssindex 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