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
Thanks for the contribution of the author. I have a good idea to deal with the problem of
tags. the problem may be caused by incomplete regular matching, I found that thetag has a similar problem,
so it can be solved in this way.replace the label with regular before comparison
toHtml(text) { var reg1 = /<p/g; var reg2 = /<\/p>/g; var reg3 = /<strong/g; var reg4 = /<\/strong>/g; text = text.replace(reg1, "<div class='type-p' "); text = text.replace(reg2, "</div><div class='end-p'></div>"); text = text.replace(reg3, "<div class='type-strong' "); text = text.replace(reg4, "</div><div class='end-strong'></div>"); return text; }, diffhtml = HtmlDiff.execute(this.toHtml(actionData),this.toHtml(newData))
replaced after comparison
toEditor(text) { // 在转换后把p标签和strong标签换回来 var reg5 = /<div class='type-p' /g; var reg6 = /<\/div><div class=\'end-p\'><\/div>/g; var reg7 = /<div class='type-strong' /g; var reg8 = /<\/div><div class=\'end-strong\'><\/div>/g; text = text.replace(reg5, "<p"); text = text.replace(reg6, "</p>"); text = text.replace(reg7, "<strong"); text = text.replace(reg8, "</strong>"); return text; }, diffhtml = this.toEditor(diffhtml)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for the contribution of the author. I have a good idea to deal with the problem of
tags.
the problem may be caused by incomplete regular matching, I found that thetag has a similar problem,
so it can be solved in this way.replace the label with regular before comparison
replaced after comparison
The text was updated successfully, but these errors were encountered: