Skip to content

Commit 3c632f8

Browse files
committed
🐛 exclude undefined itemprop
1 parent f946116 commit 3c632f8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/devto/post/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function html(content) {
1515
`
1616
}
1717

18-
const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
18+
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
1919

2020
return `
2121
<span aria-label="dev.to article" class="post" ${itemprop} itemscope itemtype="https://schema.org/Article">

src/devto/user/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function html(content) {
1717
`
1818
}
1919

20-
const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
20+
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
2121

2222
return `
2323
<section aria-label="dev.to user profile" ${itemprop} itemscope itemtype="https://schema.org/ProfilePage">

src/github/repository/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function html(content) {
1818
`
1919
}
2020

21-
const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
21+
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
2222

2323
return `
2424
<section aria-label="GitHub repository" class="repo" ${itemprop} itemscope itemtype="https://schema.org/SoftwareSourceCode">

src/github/user/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function html(content) {
1919
`
2020
}
2121

22-
const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
22+
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
2323

2424
return `
2525
<section aria-label="GitHub user profile" ${itemprop} itemscope itemtype="https://schema.org/ProfilePage">

0 commit comments

Comments
 (0)