mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
开始标点优化;
This commit is contained in:
@@ -252,13 +252,11 @@
|
|||||||
|
|
||||||
|
|
||||||
$('#settle-content-mark').click(function () {
|
$('#settle-content-mark').click(function () {
|
||||||
var content = editor.getHtml();
|
|
||||||
var contentDom = $(content);
|
|
||||||
|
|
||||||
var newContentDom = [];
|
var contentDom = editor.getEditableContainer();
|
||||||
contentDom.each(function (index, elem) {
|
$(contentDom).find('.w-e-scroll>div').children().each(function (index, elem) {
|
||||||
var tagName = elem.tagName;
|
var tagName = elem.tagName;
|
||||||
|
console.log(elem);
|
||||||
var settleTagList = [
|
var settleTagList = [
|
||||||
'P',
|
'P',
|
||||||
'H1',
|
'H1',
|
||||||
@@ -268,7 +266,7 @@
|
|||||||
'UL',
|
'UL',
|
||||||
];
|
];
|
||||||
if (settleTagList.indexOf(tagName) < 0) {
|
if (settleTagList.indexOf(tagName) < 0) {
|
||||||
newContentDom.push(elem)
|
|
||||||
return true;
|
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('?', '?');
|
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)
|
$(elem).html(html)
|
||||||
|
|
||||||
newContentDom.push(elem)
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
editor.clear()
|
return false;
|
||||||
|
|
||||||
newContentDom.forEach(elem => {
|
|
||||||
var outerHTML = $(elem).prop('outerHTML');
|
|
||||||
console.log(outerHTML);
|
|
||||||
editor.dangerouslyInsertHtml(outerHTML)
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user