Removing Entity References

Last post 01-15-2010, 9:36 AM by Adam. 2 replies.
Sort Posts: Previous Next
  •  01-14-2010, 12:33 PM 58172

    Removing Entity References

    Hi, I was just wondering if there was a way to strip certain entity references? For instance, I have a client who is pasting in their content from MS Word. While they are using the MS Word clean up function, things like smart quotes (̻) and non-breaking spaces (&nbsp) still appear to be getting through. Is there a setting available to get rid of these or should I replace these entities on the server side?
     
    Thanks in advance for your help!
  •  01-14-2010, 9:36 PM 58178 in reply to 58172

    Re: Removing Entity References

    Hi Spell,
     
    You can replace it like below
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head runat="server">   
    7.     <title>example</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <div>   
    12.             <CE:Editor ID="editor1" runat="server">   
    13.             </CE:Editor>   
    14.         </div>   
    15.     </form>   
    16. </body>   
    17. </html>   
    18.   
    19. <script>   
    20. function CuteEditor_FilterHTML(editor,code)   
    21. {   
    22.  return code.replace("&nbsp;""");   
    23. }   
    24. function CuteEditor_FilterCode(editor,code)   
    25. {   
    26.  return code.replace("&nbsp;""");   
    27. }   
    28. </script>  
    Regards,
     
    ken
  •  01-15-2010, 9:36 AM 58190 in reply to 58172

    Re: Removing Entity References

    Spell:
    Hi, I was just wondering if there was a way to strip certain entity references? For instance, I have a client who is pasting in their content from MS Word. While they are using the MS Word clean up function, things like smart quotes (̻) and non-breaking spaces (&nbsp) still appear to be getting through. Is there a setting available to get rid of these or should I replace these entities on the server side?
     
    Thanks in advance for your help!
     
    I don't think all smart quotes and non-breaking spaces are replaced when pasting. I did many tests. It only happens to some particular non-english word document.
     
    Another idea is setting UseHTMLEntities to false then try your word document.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML