Merge remote-tracking branch 'origin/develop' into settings-modal
* origin/develop: (22 commits) changelog alignment fixes Update CHANGELOG.md StillImage: Make it work properly in both firefox and chrome. ReactButton: Change the combined emoji (heart) to a simple one. Linting fixes. Settings: Keep a local version of the mutedWordsString MediaModal: Close on browser navigation events. StatusContent: Try to get hashtag from dataset first. Docs: Change wrong documentation. EntityNormalizerSpec: More fixes. EntityNormalizerSpec: Test new behavior. EntityNormalizer: Add colons to emoji alt text. fixed case in class name The sidebarRight option wasn't being read Use consistent naming for Pleroma-FE in README Remove mention of GNU Social lint multiple fixes fix non-mention notifs ...
This commit is contained in:
commit
9e3e6b0c69
21 changed files with 195 additions and 64 deletions
|
@ -538,9 +538,11 @@ const fetchTimeline = ({
|
|||
if (timeline === 'public' || timeline === 'publicAndExternal') {
|
||||
params.push(['only_media', false])
|
||||
}
|
||||
if (timeline !== 'favorites') {
|
||||
params.push(['with_muted', withMuted])
|
||||
}
|
||||
|
||||
params.push(['limit', 20])
|
||||
params.push(['with_muted', withMuted])
|
||||
|
||||
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
||||
url += `?${queryString}`
|
||||
|
|
|
@ -210,7 +210,7 @@ export const addEmojis = (string, emojis) => {
|
|||
const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\$&')
|
||||
return acc.replace(
|
||||
new RegExp(`:${regexSafeShortCode}:`, 'g'),
|
||||
`<img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' />`
|
||||
`<img src='${emoji.url}' alt=':${emoji.shortcode}:' title=':${emoji.shortcode}:' class='emoji' />`
|
||||
)
|
||||
}, string)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { filter } from 'lodash'
|
||||
import sanitize from 'sanitize-html'
|
||||
|
||||
export const removeAttachmentLinks = (html) => {
|
||||
|
@ -12,4 +13,14 @@ export const parse = (html) => {
|
|||
return removeAttachmentLinks(html)
|
||||
}
|
||||
|
||||
export const muteWordHits = (status, muteWords) => {
|
||||
const statusText = status.text.toLowerCase()
|
||||
const statusSummary = status.summary.toLowerCase()
|
||||
const hits = filter(muteWords, (muteWord) => {
|
||||
return statusText.includes(muteWord.toLowerCase()) || statusSummary.includes(muteWord.toLowerCase())
|
||||
})
|
||||
|
||||
return hits
|
||||
}
|
||||
|
||||
export default parse
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue