mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Better formatting of tweet titles
This commit is contained in:
parent
e943f91acf
commit
53e81cc06e
2 changed files with 3 additions and 3 deletions
BIN
android/Omnivore/app/release/app-release.aab
Normal file
BIN
android/Omnivore/app/release/app-release.aab
Normal file
Binary file not shown.
|
|
@ -134,8 +134,8 @@ const getTweetsByIds = async (ids: string[]): Promise<Tweets> => {
|
|||
return response.data
|
||||
}
|
||||
|
||||
const titleForAuthor = (author: { name: string }) => {
|
||||
return `${author.name} on Twitter`
|
||||
const titleForTweet = (author: { name: string }, text: string) => {
|
||||
return `${author.name} on Twitter: ${text.replace(/http\S+/, '')}`
|
||||
}
|
||||
|
||||
const tweetIdFromStatusUrl = (url: string): string | undefined => {
|
||||
|
|
@ -319,7 +319,7 @@ export class TwitterHandler extends ContentHandler {
|
|||
const authorId = tweetData.author_id
|
||||
const author = tweet.includes.users.filter((u) => (u.id = authorId))[0]
|
||||
// escape html entities in title
|
||||
const title = titleForAuthor(author)
|
||||
const title = titleForTweet(author, tweetData.text)
|
||||
const escapedTitle = _.escape(title)
|
||||
const authorImage = author.profile_image_url.replace('_normal', '_400x400')
|
||||
const description = _.escape(tweetData.text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue