We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: If styleConfig: headingStyle = 'linebreak' || 'hashify', header elements are not getting processed i.e elements remains as it is.
Content used: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
Code: htmlToPlainText(plainText.html(), {headingStyle: 'linebreak'});
Reason I found: The corresponding regular expressions are not matching the header elements.
The text was updated successfully, but these errors were encountered:
Hi! Will check it, thank you for the issue!
Attila
Sorry, something went wrong.
Hi @stubendek .. I have fixed the issue, but not able to push the code due to lack of permissions.
Fix i given; Changed the regular expression used to match header elements
// handle headings if(headingStyle === "linebreak") { tmp = tmp.replace(/<h([1-6])[^>]*>(((?!<\/h\1>).)*)<\/h\1>/gi, function(str, p1, p2) { return "\n" + p2 + "\n"; }); } else if(headingStyle === "hashify") { tmp = tmp.replace(/<h([1-6])[^>]*>(((?!<\/h\1>).)*)<\/h\1>/gi, function(str, p1, p2) { return "\n \n" + populateChar("#", p1) + " " + p2 + "\n \n"; }); }
everyone can use this fix by installing my fork: yarn add Grawl/textversionjs
yarn add Grawl/textversionjs
No branches or pull requests
Issue: If styleConfig: headingStyle = 'linebreak' || 'hashify', header elements are not getting processed i.e elements remains as it is.
Content used: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
Code: htmlToPlainText(plainText.html(), {headingStyle: 'linebreak'});
Reason I found: The corresponding regular expressions are not matching the header elements.
The text was updated successfully, but these errors were encountered: