Merge pull request #2424 from omnivore-app/fix/twitter

fix: tweet not saved
This commit is contained in:
Hongbo Wu 2023-06-26 21:55:56 +08:00 committed by GitHub
commit 6ef970a6e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -288,7 +288,10 @@ export class NitterHandler extends ContentHandler {
const tweet = parseTweet(item)
// filter out replies
if (tweet && tweet.author.username.toLowerCase() === username) {
if (
tweet &&
tweet.author.username.toLowerCase() === username.toLowerCase()
) {
tweets.push(tweet)
}
}
@ -347,7 +350,7 @@ export class NitterHandler extends ContentHandler {
'_normal',
'_400x400'
)}`
const description = _.escape(tweet.text)
const description = _.escape(tweet.text) || escapedTitle
const imageDomain =
domain.toLowerCase() === 'twitter.com'
? 'https://pbs.twimg.com'
@ -378,10 +381,7 @@ export class NitterHandler extends ContentHandler {
)
.join('\n')
tweetsContent += `
<p>${text}</p>
${includesHtml}
`
tweetsContent += `<p class="_omnivore_tweet_content">${text}</p>${includesHtml}`
}
const tweetUrl = `
@ -402,6 +402,7 @@ export class NitterHandler extends ContentHandler {
<meta property="og:site_name" content="Twitter" />
<meta property="og:type" content="tweet" />
<meta property="dc:creator" content="${author.name}" />
<meta property="twitter:description" content="${description}" />
</head>
<body>
<div class="_omnivore_twitter">

View file

@ -586,3 +586,8 @@ on smaller screens we display the note icon
-webkit-line-clamp: 2;
overflow: hidden;
}
.article-inner-css ._omnivore_tweet_content {
white-space: pre-wrap;
overflow-wrap: break-word;
}