Skip to content

Commit

Permalink
fix: update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Timmer committed Nov 21, 2024
1 parent ea674a2 commit a9b5b16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions __tests__/parse-document/1.1/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Parse document', () => {
},
density: 300,
forceImage: false,
removeSpecialCharacters: true,
decodeHtmlEntities: true,
});

expect(result).toEqual('Dummy result with special characters');
Expand All @@ -46,7 +46,7 @@ describe('Parse document', () => {
},
density: 300,
forceImage: false,
removeSpecialCharacters: false,
decodeHtmlEntities: false,
});

expect(result).toEqual('Dummy result with special characters');
Expand Down
6 changes: 3 additions & 3 deletions functions/parse-document/1.1/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
"default": true
},
"advanced": true,
"name": "removeSpecialCharacters",
"label": "Remove Special Characters",
"info": "Remove special characters from the output."
"name": "decodeHtmlEntities",
"label": "Decode html entities",
"info": "Decode some html entities to normal characters such as:   into ' '"
},
{
"name": "result",
Expand Down
4 changes: 2 additions & 2 deletions functions/parse-document/1.1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const parseDocument = async ({
document,
density,
forceImage,
removeSpecialCharacters,
decodeHtmlEntities,
}) => {
const url = isFileProperty(document) ? document?.url : document;

Expand All @@ -14,7 +14,7 @@ const parseDocument = async ({
parserOptions: { density, forceImage },
});

if (removeSpecialCharacters && typeof result === 'string') {
if (decodeHtmlEntities && typeof result === 'string') {
return { result: result.replaceAll(' ', ' ') };
}

Expand Down

0 comments on commit a9b5b16

Please sign in to comment.