mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
开始标点优化;
This commit is contained in:
@@ -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()
|
||||
|
||||
newContentDom.forEach(elem => {
|
||||
var outerHTML = $(elem).prop('outerHTML');
|
||||
console.log(outerHTML);
|
||||
editor.dangerouslyInsertHtml(outerHTML)
|
||||
});
|
||||
return false;
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user