From 06042569f1d2f2c7217917459df007adbb113e53 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:10:45 +0200 Subject: [PATCH 01/18] fix alignment issues --- src/components/mention_link/mention_link.scss | 2 +- src/components/popover/popover.vue | 2 +- src/components/status/status.scss | 10 ++++++++-- src/components/status/status.vue | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/mention_link/mention_link.scss b/src/components/mention_link/mention_link.scss index 03306dcc..23d18f59 100644 --- a/src/components/mention_link/mention_link.scss +++ b/src/components/mention_link/mention_link.scss @@ -3,7 +3,7 @@ .MentionLink { position: relative; white-space: normal; - display: inline-block; + display: inline-flex; color: var(--link); & .new, diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index 2e78a09e..8588b351 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -33,7 +33,7 @@ @import '../../_variables.scss'; .popover-trigger-button { - display: block; + display: inline-block; } .popover { diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 71305dd7..24c840ac 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -165,16 +165,23 @@ $status-margin: 0.75em; align-content: baseline; font-size: 12px; line-height: 160%; + margin-top: 0.2em; + line-height: 130%; + max-width: 100%; align-items: stretch; } & .reply-to-popover, - & .reply-to-no-popover { + & .reply-to-no-popover, + & .mentions { min-width: 0; margin-right: 0.4em; flex-shrink: 0; } + .reply-glued-label { + margin-right: 0.5em; + } .reply-to-popover { .reply-to:hover::before { @@ -209,7 +216,6 @@ $status-margin: 0.75em; & .reply-to { white-space: nowrap; position: relative; - padding-right: 0.25em; } & .mentions-text, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 2684e415..3bb29db6 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -227,7 +227,7 @@ > Date: Thu, 3 Feb 2022 22:23:28 +0200 Subject: [PATCH 02/18] fix poast mentions tripping --- src/components/rich_content/rich_content.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index c0d20c5e..46bc661a 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -120,7 +120,8 @@ export default Vue.component('RichContent', { // don't include spaces when processing mentions - we'll include them // in MentionsLine lastSpacing = item - return currentMentions !== null ? item.trim() : item + // Don't remove last space in a container (fixes poast mentions) + return (index !== array.length - 1) && (currentMentions !== null) ? item.trim() : item } currentMentions = null From bfb3a4364be3f71f7c46056aeb8972f04a072703 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:34:57 +0200 Subject: [PATCH 03/18] options to disable (You)s and highlighting of yourself --- src/components/mention_link/mention_link.js | 8 +++++++- src/components/mention_link/mention_link.vue | 4 ++-- src/components/settings_modal/tabs/general_tab.vue | 10 ++++++++++ src/i18n/en.json | 2 ++ src/modules/config.js | 2 ++ src/modules/instance.js | 2 ++ 6 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 5209907d..55eea195 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -87,7 +87,7 @@ const MentionLink = { classnames () { return [ { - '-you': this.isYou, + '-you': this.isYou && this.shouldBoldenYou, '-highlighted': this.highlight }, this.highlightType @@ -115,6 +115,12 @@ const MentionLink = { shouldShowAvatar () { return this.mergedConfig.mentionLinkShowAvatar }, + shouldShowYous () { + return this.mergedConfig.mentionLinkShowYous + }, + shouldBoldenYou () { + return this.mergedConfig.mentionLinkBoldenYou + }, shouldFadeDomain () { return this.mergedConfig.mentionLinkFadeDomain }, diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index ac20eb5a..d8ab79fb 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -45,8 +45,8 @@ v-html="'@' + serverName" /> {{ $t('status.you') }} diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 44b1ac92..eba3b268 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -147,6 +147,11 @@ {{ $t('settings.greentext') }} +
  • + + {{ $t('settings.show_yous') }} + +
  • +
  • + + {{ $t('settings.mention_link_bolden_you') }} + +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 209fd184..8fd189c6 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -493,8 +493,10 @@ "mention_link_show_tooltip": "Show full user names as tooltip for remote users", "mention_link_show_avatar": "Show user avatar beside the link", "mention_link_fade_domain": "Fade domains (e.g. @example.org in @foo@example.org)", + "mention_link_bolden_you": "Bolden text of your mention", "fun": "Fun", "greentext": "Meme arrows", + "show_yous": "Show (You)s", "notifications": "Notifications", "notification_setting_filters": "Filters", "notification_setting_block_from_strangers": "Block notifications from users who you do not follow", diff --git a/src/modules/config.js b/src/modules/config.js index 9f2d4ef3..20979174 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -76,6 +76,8 @@ export const defaultState = { mentionLinkShowTooltip: undefined, // instance default mentionLinkShowAvatar: undefined, // instance default mentionLinkFadeDomain: undefined, // instance default + mentionLinkShowYous: undefined, // instance default + mentionLinkBoldenYou: undefined, // instance default hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default diff --git a/src/modules/instance.js b/src/modules/instance.js index d686f258..1abd784f 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -25,6 +25,8 @@ const defaultState = { mentionLinkShowTooltip: true, mentionLinkShowAvatar: false, mentionLinkFadeDomain: true, + mentionLinkShowYous: false, + mentionLinkBoldenYou: true, hideFilteredStatuses: false, // bad name: actually hides posts of muted USERS hideMutedPosts: false, From ea6114f63c972ac974f8e3055b93ae3340b6e85b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:36:13 +0200 Subject: [PATCH 04/18] better phrasing? --- src/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index 8fd189c6..77f7e5b0 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -493,7 +493,7 @@ "mention_link_show_tooltip": "Show full user names as tooltip for remote users", "mention_link_show_avatar": "Show user avatar beside the link", "mention_link_fade_domain": "Fade domains (e.g. @example.org in @foo@example.org)", - "mention_link_bolden_you": "Bolden text of your mention", + "mention_link_bolden_you": "Highlight mention of you when you are mentioned", "fun": "Fun", "greentext": "Meme arrows", "show_yous": "Show (You)s", From 9a6363431d8f17cc1ee027eb498181d157fefdb7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:41:38 +0200 Subject: [PATCH 05/18] lint --- src/components/status/status.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 24c840ac..0f527def 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -164,10 +164,8 @@ $status-margin: 0.75em; position: relative; align-content: baseline; font-size: 12px; - line-height: 160%; margin-top: 0.2em; line-height: 130%; - max-width: 100%; align-items: stretch; } @@ -179,6 +177,7 @@ $status-margin: 0.75em; margin-right: 0.4em; flex-shrink: 0; } + .reply-glued-label { margin-right: 0.5em; } From a9830ff4913a56a3ff097505a4e65bb61117b4d5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:50:32 +0200 Subject: [PATCH 06/18] support width/height img attributes --- src/components/still-image/still-image.js | 11 ++++++++++- src/components/still-image/still-image.vue | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index 8044e994..d7abbcb5 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -5,7 +5,9 @@ const StillImage = { 'mimetype', 'imageLoadError', 'imageLoadHandler', - 'alt' + 'alt', + 'height', + 'width' ], data () { return { @@ -15,6 +17,13 @@ const StillImage = { computed: { animated () { return this.stopGifs && (this.mimetype === 'image/gif' || this.src.endsWith('.gif')) + }, + style () { + const appendPx = (str) => /\d$/.test(str) ? str + 'px' : str + return { + height: this.height ? appendPx(this.height) : null, + width: this.width ? appendPx(this.width) : null + } } }, methods: { diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 0623b42e..cca75fcb 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -2,6 +2,7 @@
    Date: Thu, 3 Feb 2022 22:52:41 +0200 Subject: [PATCH 07/18] make chat messages behave same as posts for animated gifs --- src/components/chat_message/chat_message.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/chat_message/chat_message.scss b/src/components/chat_message/chat_message.scss index fcfa7c8a..5445d9f7 100644 --- a/src/components/chat_message/chat_message.scss +++ b/src/components/chat_message/chat_message.scss @@ -1,6 +1,7 @@ @import '../../_variables.scss'; .chat-message-wrapper { + &.hovered-message-chain { .animated.Avatar { canvas { @@ -40,6 +41,12 @@ .chat-message { display: flex; padding-bottom: 0.5em; + + .status-body:hover { + --_still-image-img-visibility: visible; + --_still-image-canvas-visibility: hidden; + --_still-image-label-visibility: hidden; + } } .avatar-wrapper { From 39ecb338830a71c015688e7ec45e16e1151983d3 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:58:12 +0200 Subject: [PATCH 08/18] fix amps in links --- src/components/rich_content/rich_content.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 46bc661a..8ebabad7 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -60,7 +60,7 @@ export default Vue.component('RichContent', { // NEVER EVER TOUCH DATA INSIDE RENDER render (h) { // Pre-process HTML - const { newHtml: html } = preProcessPerLine(this.html, this.greentext) + const { newHtml: html } = preProcessPerLine(unescape(this.html), this.greentext) let currentMentions = null // Current chain of mentions, we group all mentions together // This is used to recover spacing removed when parsing mentions let lastSpacing = '' From 571e73a346996f1bcdecb6545b44351a65fee3cb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 23:13:28 +0200 Subject: [PATCH 09/18] better approach to unescaping --- src/components/rich_content/rich_content.jsx | 2 +- src/services/html_converter/html_tree_converter.service.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 8ebabad7..46bc661a 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -60,7 +60,7 @@ export default Vue.component('RichContent', { // NEVER EVER TOUCH DATA INSIDE RENDER render (h) { // Pre-process HTML - const { newHtml: html } = preProcessPerLine(unescape(this.html), this.greentext) + const { newHtml: html } = preProcessPerLine(this.html, this.greentext) let currentMentions = null // Current chain of mentions, we group all mentions together // This is used to recover spacing removed when parsing mentions let lastSpacing = '' diff --git a/src/services/html_converter/html_tree_converter.service.js b/src/services/html_converter/html_tree_converter.service.js index 6a8796c4..247a8173 100644 --- a/src/services/html_converter/html_tree_converter.service.js +++ b/src/services/html_converter/html_tree_converter.service.js @@ -1,4 +1,5 @@ import { getTagName } from './utility.service.js' +import { unescape } from 'lodash' /** * This is a not-so-tiny purpose-built HTML parser/processor. This parses html @@ -49,7 +50,7 @@ export const convertHtmlToTree = (html = '') => { const handleOpen = (tag) => { const curBuf = getCurrentBuffer() - const newLevel = [tag, []] + const newLevel = [unescape(tag), []] levels.push(newLevel) curBuf.push(newLevel) } From d361a4d7dc18bd7c722ed76a894ebee8e5a50ed5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 4 Feb 2022 14:20:56 +0200 Subject: [PATCH 10/18] fix overflows --- src/components/mention_link/mention_link.scss | 12 ++++++++---- src/components/mentions_line/mentions_line.scss | 7 ++----- src/components/status/status.scss | 2 ++ src/components/status_body/status_body.scss | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/mention_link/mention_link.scss b/src/components/mention_link/mention_link.scss index 23d18f59..c7db7fb9 100644 --- a/src/components/mention_link/mention_link.scss +++ b/src/components/mention_link/mention_link.scss @@ -3,12 +3,12 @@ .MentionLink { position: relative; white-space: normal; - display: inline-flex; + display: inline; color: var(--link); & .new, & .original { - display: inline-block; + display: inline; border-radius: 2px; } @@ -38,8 +38,8 @@ user-select: all; } - .short.-with-tooltip, - .you { + & .short.-with-tooltip, + & .you { user-select: none; } @@ -48,6 +48,10 @@ white-space: nowrap; } + .shortName { + white-space: normal; + } + .new { &.-you { & .shortName, diff --git a/src/components/mentions_line/mentions_line.scss b/src/components/mentions_line/mentions_line.scss index b9d5c14a..1a485860 100644 --- a/src/components/mentions_line/mentions_line.scss +++ b/src/components/mentions_line/mentions_line.scss @@ -1,11 +1,8 @@ .MentionsLine { + word-break: break-all; + .showMoreLess { white-space: normal; color: var(--link); } - - .fullExtraMentions, - .mention-link:not(:last-child) { - margin-right: 0.25em; - } } diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 0f527def..2028ade9 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -5,6 +5,8 @@ $status-margin: 0.75em; .Status { min-width: 0; white-space: normal; + word-wrap: break-word; + word-break: break-word; &:hover { --_still-image-img-visibility: visible; diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss index c7732bfe..51623a26 100644 --- a/src/components/status_body/status_body.scss +++ b/src/components/status_body/status_body.scss @@ -9,7 +9,7 @@ & .text, & .summary { font-family: var(--postFont, sans-serif); - white-space: pre-wrap; + white-space: normal; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; From 4c7edfc9a9865003483bc4b78d29bb554e7901ad Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 9 Feb 2022 23:34:06 +0200 Subject: [PATCH 11/18] more spacing/wrapping fixes --- src/components/mention_link/mention_link.scss | 1 + src/components/mention_link/mention_link.vue | 8 +++----- src/components/mentions_line/mentions_line.scss | 1 + src/components/status_body/status_body.scss | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/mention_link/mention_link.scss b/src/components/mention_link/mention_link.scss index c7db7fb9..a4326296 100644 --- a/src/components/mention_link/mention_link.scss +++ b/src/components/mention_link/mention_link.scss @@ -5,6 +5,7 @@ white-space: normal; display: inline; color: var(--link); + word-break: normal; & .new, & .original { diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index d8ab79fb..13786c3a 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -43,14 +43,12 @@ class="serverName" :class="{ '-faded': shouldFadeDomain }" v-html="'@' + serverName" - /> - {{ $t('status.you') }} + > {{ $t('status.you') }} - - Date: Fri, 11 Feb 2022 15:06:12 +0200 Subject: [PATCH 12/18] more spacing fixes --- src/components/mention_link/mention_link.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index 13786c3a..3562f511 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -9,9 +9,7 @@ class="original" target="_blank" v-html="content" - /> - - Date: Fri, 11 Feb 2022 15:10:52 +0200 Subject: [PATCH 13/18] more spacing fixes --- src/components/mentions_line/mentions_line.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/mentions_line/mentions_line.scss b/src/components/mentions_line/mentions_line.scss index 9650a9a4..9a622e75 100644 --- a/src/components/mentions_line/mentions_line.scss +++ b/src/components/mentions_line/mentions_line.scss @@ -1,6 +1,10 @@ .MentionsLine { word-break: break-all; + .mention-link:not(:first-child)::before { + content: ' '; + } + .showMoreLess { margin-left: 0.5em; white-space: normal; From a61f6e1590ce82e3c81203193469acb461b0ba4b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 19 Feb 2022 22:12:37 +0200 Subject: [PATCH 14/18] use rich content in interaction lists --- src/components/user_list_popover/user_list_popover.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/user_list_popover/user_list_popover.vue b/src/components/user_list_popover/user_list_popover.vue index f4b93c9a..e706bd1b 100644 --- a/src/components/user_list_popover/user_list_popover.vue +++ b/src/components/user_list_popover/user_list_popover.vue @@ -22,7 +22,12 @@ />
    - + {{ user.screen_name_ui }}
    @@ -47,6 +52,7 @@ .user-list-popover { padding: 0.5em; + --emoji-size: 16px; .user-list-row { padding: 0.25em; From 769a9a14fe99785270596ac587ac65f48d2043ac Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 19 Feb 2022 22:22:21 +0200 Subject: [PATCH 15/18] add emoji to chat titles --- src/components/chat_title/chat_title.vue | 18 ++++++------------ .../user_list_popover/user_list_popover.vue | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/chat_title/chat_title.vue b/src/components/chat_title/chat_title.vue index b16ed39d..a92028e8 100644 --- a/src/components/chat_title/chat_title.vue +++ b/src/components/chat_title/chat_title.vue @@ -1,5 +1,4 @@ @@ -34,6 +34,8 @@ white-space: nowrap; align-items: center; + --emoji-size: 14px; + .username { max-width: 100%; text-overflow: ellipsis; @@ -41,14 +43,6 @@ display: inline; word-wrap: break-word; overflow: hidden; - text-overflow: ellipsis; - - .emoji { - width: 14px; - height: 14px; - vertical-align: middle; - object-fit: contain - } } .Avatar { diff --git a/src/components/user_list_popover/user_list_popover.vue b/src/components/user_list_popover/user_list_popover.vue index e706bd1b..8706d0ff 100644 --- a/src/components/user_list_popover/user_list_popover.vue +++ b/src/components/user_list_popover/user_list_popover.vue @@ -52,6 +52,7 @@ .user-list-popover { padding: 0.5em; + --emoji-size: 16px; .user-list-row { From 0d073d607cb2d033a9556eca64c5e905864ba2ed Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 19 Feb 2022 22:34:08 +0200 Subject: [PATCH 16/18] enable link handling in user bios to fix links not having _blank --- src/components/user_card/user_card.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5f957003..0708f387 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -275,6 +275,7 @@ class="user-card-bio" :html="user.description_html" :emoji="user.emoji" + :handle-links="true" />
    From a8d198768639435bad93a527228f62575eed37c0 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 19 Feb 2022 22:40:19 +0200 Subject: [PATCH 17/18] fix unit tests --- test/unit/specs/components/rich_content.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index f6c478a9..8a29bd6e 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -350,7 +350,6 @@ describe('RichContent', () => { '', '', '', - ' ', '', // v-if placeholder, mentionlink's "new" (i.e. rich) display '', '', // v-if placeholder, mentionsline's extra mentions and stuff From 86e3aefdab3fa1314d4731eabcf03f8c9e418e41 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 19 Feb 2022 23:04:51 +0200 Subject: [PATCH 18/18] new unit tests --- .../specs/components/rich_content.spec.js | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index 8a29bd6e..30c66a33 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -374,6 +374,84 @@ describe('RichContent', () => { expect(wrapper.html()).to.eql(compwrap(expected)) }) + it('rich contents of nested mentions are handled properly', () => { + attentions.push({ statusnet_profile_url: 'lol' }) + const html = [ + p( + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + ' ', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '' + ), + p( + 'Testing' + ) + ].join('') + const expected = [ + p( + '', + '', + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', + '', // v-if placeholder, mentionsline's extra mentions and stuff + '', + '' + ), + ' ', + p( + 'Testing' + ) + ].join('') + + const wrapper = mount(RichContent, { + localVue, + propsData: { + attentions, + handleLinks: true, + greentext: true, + emoji: [], + html + } + }) + + expect(wrapper.html()).to.eql(compwrap(expected)) + }) + it('rich contents of a link are handled properly', () => { const html = [ '

    ',