Fix error for empty typebox
This commit is contained in:
parent
5e9405207b
commit
1c3674b52d
1 changed files with 12 additions and 14 deletions
|
@ -470,16 +470,15 @@ class MarkDown{
|
|||
restore();
|
||||
}
|
||||
static gatherBoxText(element:HTMLElement){
|
||||
const children=element.childNodes;
|
||||
if(element.tagName.toLowerCase()==="img"){
|
||||
return (element as HTMLImageElement).alt;
|
||||
}
|
||||
if(element.tagName.toLowerCase()==="br"){
|
||||
return "\n";
|
||||
}
|
||||
if(children.length!==0){
|
||||
|
||||
let build="";
|
||||
for(const thing of children){
|
||||
for(const thing of element.childNodes){
|
||||
|
||||
if(thing instanceof Text){
|
||||
|
||||
|
@ -495,7 +494,6 @@ class MarkDown{
|
|||
return build;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//solution from https://stackoverflow.com/questions/4576694/saving-and-restoring-caret-position-for-contenteditable-div
|
||||
function saveCaretPosition(context){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue