You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code
I copied a text from the mac memo and chose "insert_only_text" option. However, i got a result which is not my expect.
After read the source code, i found it not handle the text which includes a <style> tag.
So i change it like this, that works.
// A *self-contained* demonstration of the problem follows.../** * Extract plain text from HTML text */
export functionstripTags(html: string|Node,doc: Document=document): string{consttmp=doc.createElement('div');if(isString(html)){tmp.innerHTML=html;}else{tmp.appendChild(html);}$$('DIV, P, BR, H1, H2, H3, H4, H5, H6, HR, STYLE',tmp).forEach(p=>{constpr=p.parentNode;if(!pr){return;}if(p.nodeName==='STYLE'){tmp.removeChild(p);}constnx=p.nextSibling;if(Dom.isText(nx)&&/^\s/.test(nx.nodeValue||'')){return;}if(nx){pr.insertBefore(doc.createTextNode(' '),nx);}});returntrim(tmp.innerText)||'';}
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered:
Jodit Version: 3.24.2
Browser: Chrome
OS: Mac
Is React App: True
Code
I copied a text from the mac memo and chose "insert_only_text" option. However, i got a result which is not my expect.
After read the source code, i found it not handle the text which includes a <style> tag.
So i change it like this, that works.
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: