Merge pull request #1423 from omnivore-app/fix/cloud-build-failure
fix: content-fetch-gcf cloud build failure
This commit is contained in:
@ -6,11 +6,11 @@
|
||||
"dependencies": {
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"@google-cloud/functions-framework": "^3.0.0",
|
||||
"@omnivore/puppeteer-parse": "^1.0.0",
|
||||
"@sentry/serverless": "^6.13.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@google-cloud/functions-framework": "^3.0.0",
|
||||
"chai": "^4.3.6",
|
||||
"mocha": "^10.0.0"
|
||||
},
|
||||
|
||||
@ -12,7 +12,6 @@ export class GitHubHandler extends ContentHandler {
|
||||
|
||||
async preParse(url: string, dom: Document): Promise<Document> {
|
||||
const body = dom.querySelector('body')
|
||||
const head = dom.querySelector('head')
|
||||
const article = dom.querySelector('article')
|
||||
const twitterTitle = dom.querySelector(`meta[name='twitter:title']`)
|
||||
const linkAuthor = dom.querySelector(`span[itemprop='author']`)
|
||||
@ -34,7 +33,10 @@ export class GitHubHandler extends ContentHandler {
|
||||
// Remove the GitHub - and repo org from the title
|
||||
const twitterTitleContent = twitterTitle?.getAttribute('content')
|
||||
if (twitterTitle && twitterTitleContent) {
|
||||
twitterTitle.setAttribute('content', twitterTitleContent.replace(/GitHub - .*\//, ''))
|
||||
twitterTitle.setAttribute(
|
||||
'content',
|
||||
twitterTitleContent.replace(/GitHub - .*\//, '')
|
||||
)
|
||||
}
|
||||
|
||||
return Promise.resolve(dom)
|
||||
|
||||
Reference in New Issue
Block a user