File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default {
100100 * Check text in PDF
101101 * @param filePath {string|null} Path of the PDF file
102102 * @param text {string} Text to check on the file
103- * @param deleteComma {boolean} True if we need to delete comma
103+ * @param deleteComma {boolean} True if we need to delete comma. PDF to txt conversion adds comma where newlines are.
104104 * @returns {Promise<boolean> }
105105 */
106106 async isTextInPDF ( filePath : string | null , text : string , deleteComma : boolean = false ) : Promise < boolean > {
@@ -120,6 +120,7 @@ export default {
120120
121121 const pageTexts = await Promise . all ( pageTextPromises ) ;
122122
123+ // delete commas from the page text. getPageTextFromPdf adds commas to newlines in some cases
123124 if ( deleteComma ) {
124125 return ( ( pageTexts . join ( ' ' ) . split ( / , \/ / ) . join ( '/' ) . split ( / , \s * , ? / )
125126 . join ( ' ' ) )
You can’t perform that action at this time.
0 commit comments