Skip to content

Commit

Permalink
add check for text existing and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sujitv19196 committed Oct 11, 2023
1 parent 9c5a2a4 commit 8810e77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/entities/EPubs/structs/EPubChapterLikeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import EPubImageData from './EPubImageData';
function _buildContentsFromItems(items) {
const content = [];
for (const item of items) {
if (item.image) {
const altText = item.ocrPhrases ? 'OCR Phrases: ' + item.ocrPhrases : ''
if (item.image) { // if there is an image
const altText = item.ocrPhrases ? 'OCR Phrases: ' + item.ocrPhrases : '' // add in OCR data

Check failure on line 11 in src/entities/EPubs/structs/EPubChapterLikeData.js

View workflow job for this annotation

GitHub Actions / Build

Unexpected string concatenation
const imageData = new EPubImageData({src: item.image, alt: altText});
content.push(imageData)
}
const text = item.text
if (_.trim(text)) {
content.push(text);
if (item.text) { // if there is text
const text = item.text
if (_.trim(text)) {
content.push(text);
}
}
}
return content;
Expand Down

0 comments on commit 8810e77

Please sign in to comment.