-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: change table line break * feat: add semi-selective line break deletion * feat: add fragment handle * Create angry-llamas-repair.md * feat: add boundary handling and null checks
- Loading branch information
1 parent
5806829
commit c18aa53
Showing
8 changed files
with
375 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@wangeditor-next/core": patch | ||
"@wangeditor-next/editor": patch | ||
"@wangeditor-next/table-module": patch | ||
--- | ||
|
||
fix: 修复单元格内的换行在编辑模式下的视觉错误 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,4 +143,4 @@ | |
</script> | ||
</body> | ||
|
||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>simple mode</title> | ||
<link href="https://cdn.bootcdn.net/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet"> | ||
<link href="./css/view.css" rel="stylesheet"> | ||
<link href="./css/editor.css" rel="stylesheet"> | ||
<link href="../dist/css/style.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<p>表格换行符测试</p> | ||
|
||
<!-- 编辑器 --> | ||
<div> | ||
<div id="editor-toolbar" class="editor-toolbar"></div> | ||
<div id="editor-text-area" class="editor-text-area"></div> | ||
</div> | ||
|
||
<div> | ||
selection: <span id="selection-text"></span> | ||
</div> | ||
|
||
<div style="margin-top: 20px;"> | ||
<textarea id="text-content" readonly style="width: 100%; height: 500px;"></textarea> | ||
</div> | ||
|
||
<script src="js/init-content.js"></script> | ||
<script src="../dist/index.js"></script> | ||
<script> | ||
const E = window.wangEditor | ||
|
||
const content = [ | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"text": "" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "table", | ||
"width": "auto", | ||
"children": [ | ||
{ | ||
"type": "table-row", | ||
"children": [ | ||
{ | ||
"type": "table-cell", | ||
"children": [ | ||
{ | ||
"text": "多行文本\n\r" | ||
}, | ||
{ | ||
"text": "多行文本", | ||
"bgColor": "rgb(225, 60, 57)" | ||
}, | ||
{ | ||
"text": "\n\r多行文本", | ||
"bgColor": "rgb(251, 233, 230)" | ||
}, | ||
{ | ||
"text": "\n\r" | ||
}, | ||
{ | ||
"text": "多行文本\n\r多行文本", | ||
"bgColor": "rgb(255, 77, 79)" | ||
}, | ||
], | ||
"isHeader": true | ||
} | ||
] | ||
} | ||
], | ||
"columnWidths": [ | ||
276 | ||
], | ||
"scrollWidth": 276, | ||
"height": 127, | ||
"isHoverCellBorder": true, | ||
"resizingIndex": 0, | ||
"isResizing": false | ||
}, | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"text": "" | ||
} | ||
], | ||
"isHoverCellBorder": false, | ||
"resizingIndex": -1, | ||
"isResizing": false | ||
} | ||
] | ||
|
||
// const content = [ | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "" | ||
// } | ||
// ] | ||
// }, | ||
// { | ||
// "type": "table", | ||
// "width": "auto", | ||
// "children": [ | ||
// { | ||
// "type": "table-row", | ||
// "children": [ | ||
// { | ||
// "type": "table-cell", | ||
// "children": [ | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "多行文本" | ||
// } | ||
// ] | ||
// }, | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "多行文本", | ||
// "bgColor": "rgb(225, 60, 57)" | ||
// } | ||
// ] | ||
// }, | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "多行文本", | ||
// "bgColor": "rgb(251, 233, 230)" | ||
// } | ||
// ] | ||
// }, | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "多行文本", | ||
// "bgColor": "rgb(255, 77, 79)" | ||
// } | ||
// ] | ||
// }, | ||
// ], | ||
// "isHeader": true | ||
// } | ||
// ] | ||
// } | ||
// ], | ||
// "columnWidths": [ | ||
// 276 | ||
// ], | ||
// "scrollWidth": 276, | ||
// "height": 127, | ||
// "isHoverCellBorder": true, | ||
// "resizingIndex": 0, | ||
// "isResizing": false | ||
// }, | ||
// { | ||
// "type": "paragraph", | ||
// "children": [ | ||
// { | ||
// "text": "" | ||
// } | ||
// ], | ||
// "isHoverCellBorder": false, | ||
// "resizingIndex": -1, | ||
// "isResizing": false | ||
// } | ||
// ] | ||
|
||
// editor 配置 | ||
const editorConfig = {} | ||
editorConfig.placeholder = '请输入内容123...' | ||
editorConfig.onChange = (editor) => { | ||
const contentStr = JSON.stringify(editor.children, null, 2) | ||
document.getElementById('text-content').innerHTML = contentStr | ||
console.log(editor.getHtml()) | ||
const selection = editor.selection | ||
document.getElementById('selection-text').innerHTML = JSON.stringify(selection, null, 2) | ||
console.log(selection) | ||
} | ||
|
||
const editor = E.createEditor({ | ||
selector: '#editor-text-area', | ||
config: editorConfig, | ||
content, | ||
mode: 'simple' | ||
}) | ||
|
||
const toolbar = E.createToolbar({ | ||
editor, | ||
selector: '#editor-toolbar', | ||
config: {}, | ||
mode: 'simple' | ||
}) | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.