Skip to content

Commit c0c2efd

Browse files
committed
don't do any parsking on html to markdwon if empoty strings exist
1 parent 276be2b commit c0c2efd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/ExpensiMark.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,10 @@ export default class ExpensiMark {
12371237
* Replaces HTML with markdown
12381238
*/
12391239
htmlToMarkdown(htmlString: string, extras: Extras = EXTRAS_DEFAULT): string {
1240+
if (!htmlString) {
1241+
return '';
1242+
}
1243+
12401244
let generatedMarkdown = htmlString;
12411245
const body = /<(body)(?:"[^"]*"|'[^']*'|[^'"><])*>(?:\n|\r\n)?([\s\S]*?)(?:\n|\r\n)?<\/\1>(?![^<]*(<\/pre>|<\/code>))/im;
12421246
const parseBodyTag = generatedMarkdown.match(body);

0 commit comments

Comments
 (0)