开始标点优化;

This commit is contained in:
2022-03-25 22:14:32 +08:00
parent 7203f5e7f2
commit e36023b948

View File

@@ -252,13 +252,11 @@
$('#settle-content-mark').click(function () {
var content = editor.getHtml();
var contentDom = $(content);
var newContentDom = [];
contentDom.each(function (index, elem) {
var contentDom = editor.getEditableContainer();
$(contentDom).find('.w-e-scroll>div').children().each(function (index, elem) {
var tagName = elem.tagName;
console.log(elem);
var settleTagList = [
'P',
'H1',
@@ -268,7 +266,7 @@
'UL',
];
if (settleTagList.indexOf(tagName) < 0) {
newContentDom.push(elem)
return true;
}
@@ -276,27 +274,19 @@
html = html.replaceAll(',', '');
html = html.replaceAll('.', '。');
html = html.replaceAll('!', '');
html = html.replaceAll(':', '');
html = html.replaceAll(';', '');
html = html.replaceAll(':', '');
html = html.replaceAll('?', '');
// html = html.replaceAll('<', '《');
// html = html.replaceAll('>', '》');
html = html.replaceAll('/', '、');
// html = html.replaceAll('/', '、');
console.log(elem);
$(elem).html(html)
newContentDom.push(elem)
})
editor.clear()
return false;
newContentDom.forEach(elem => {
var outerHTML = $(elem).prop('outerHTML');
console.log(outerHTML);
editor.dangerouslyInsertHtml(outerHTML)
});
})