From 85ecadb6309ba43ee8bfeb21dfbdee72ff773252 Mon Sep 17 00:00:00 2001 From: Santiago Kozak Date: Wed, 16 Aug 2023 04:06:04 -0300 Subject: [PATCH 1/3] Fix hashtag bar display when status is in a thread (#26497) --- app/javascript/styles/mastodon/components.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 009d4f71d6..115b6f5d1b 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1111,7 +1111,8 @@ body > [data-popper-placement] { .audio-player, .attachment-list, .picture-in-picture-placeholder, - .status-card { + .status-card, + .hashtag-bar { margin-inline-start: $thread-margin; width: calc(100% - ($thread-margin)); } From 26eaf058e23874c35da2f7cd1a6e66d552e75f86 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:08:57 +0200 Subject: [PATCH 2/3] Update dependency postcss to v8.4.28 (#26502) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 09deddc764..4862776d95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9549,9 +9549,9 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.2.15, postcss@^8.4.24, postcss@^8.4.25: - version "8.4.27" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.27.tgz#234d7e4b72e34ba5a92c29636734349e0d9c3057" - integrity sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ== + version "8.4.28" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.28.tgz#c6cc681ed00109072816e1557f889ef51cf950a5" + integrity sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw== dependencies: nanoid "^3.3.6" picocolors "^1.0.0" From f0862bcf984d994b9f0b0bbea82431e5a1812351 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 16 Aug 2023 11:47:59 +0200 Subject: [PATCH 3/3] Fix hashtag bar sometimes including tags that appear in the post's body (#26506) --- app/javascript/mastodon/components/hashtag_bar.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/hashtag_bar.jsx b/app/javascript/mastodon/components/hashtag_bar.jsx index 6a39005e16..3ad6362551 100644 --- a/app/javascript/mastodon/components/hashtag_bar.jsx +++ b/app/javascript/mastodon/components/hashtag_bar.jsx @@ -15,11 +15,11 @@ const VISIBLE_HASHTAGS = 7; export const HashtagBar = ({ hashtags, text }) => { const renderedHashtags = useMemo(() => { const body = domParser.parseFromString(text, 'text/html').documentElement; - return [].map.call(body.querySelectorAll('[rel=tag]'), node => node.textContent.toLowerCase()); + return [].filter.call(body.querySelectorAll('a[href]'), link => link.textContent[0] === '#' || (link.previousSibling?.textContent?.[link.previousSibling.textContent.length - 1] === '#')).map(node => node.textContent.toLowerCase()); }, [text]); const invisibleHashtags = useMemo(() => ( - hashtags.filter(hashtag => !renderedHashtags.some(textContent => textContent === `#${hashtag.get('name')}` || textContent === hashtag.get('name'))) + hashtags.filter(hashtag => !renderedHashtags.some(textContent => textContent === `#${hashtag.get('name').toLowerCase()}` || textContent === hashtag.get('name').toLowerCase())) ), [hashtags, renderedHashtags]); const [expanded, setExpanded] = useState(false);