mirror of
https://github.com/tooot-app/app
synced 2024-12-22 23:58:27 +01:00
Support broader fedi tag type
This commit is contained in:
parent
50332773c3
commit
44f8900902
@ -119,7 +119,11 @@ const ParseHTML: React.FC<Props> = ({
|
|||||||
const href = node.attribs.href
|
const href = node.attribs.href
|
||||||
if (classes) {
|
if (classes) {
|
||||||
if (classes.includes('hashtag')) {
|
if (classes.includes('hashtag')) {
|
||||||
const tag = href.match(new RegExp(/\/tags?\/(.*)/, 'i'))?.[1].toLowerCase()
|
const children = node.children.map(unwrapNode).join('')
|
||||||
|
const tag =
|
||||||
|
href.match(new RegExp(/\/tags?\/(.*)/, 'i'))?.[1]?.toLowerCase() ||
|
||||||
|
children.match(new RegExp(/#(\S+)/))?.[1]?.toLowerCase()
|
||||||
|
|
||||||
const paramsHashtag = (params as { hashtag: Mastodon.Tag['name'] } | undefined)
|
const paramsHashtag = (params as { hashtag: Mastodon.Tag['name'] } | undefined)
|
||||||
?.hashtag
|
?.hashtag
|
||||||
const sameHashtag = paramsHashtag === tag
|
const sameHashtag = paramsHashtag === tag
|
||||||
@ -143,7 +147,7 @@ const ParseHTML: React.FC<Props> = ({
|
|||||||
!sameHashtag &&
|
!sameHashtag &&
|
||||||
navigation.push('Tab-Shared-Hashtag', { hashtag: tag })
|
navigation.push('Tab-Shared-Hashtag', { hashtag: tag })
|
||||||
}
|
}
|
||||||
children={node.children.map(unwrapNode).join('')}
|
children={children}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user