Some wierd tags are coming in cute editor HTML

Last post 11-07-2008, 12:00 PM by rktekula. 2 replies.
Sort Posts: Previous Next
  •  11-06-2008, 7:54 PM 45484

    Some wierd tags are coming in cute editor HTML

     
     In some of my cute editor text, I am observing following type of wierd attributes in HTML ?
    <p center?=""><strong><span>Gr. Level</span> </strong></p>
     
    <p class="MsoNormal" style="margin: 0in 0in 0pt; align: "  center?="">
     
     
     Did you observe the above two P tags ? What is   center?=""
     
     Adam any ideas ?
     
     
     Thanks
     
     
  •  11-07-2008, 1:15 AM 45492 in reply to 45484

    Re: Some wierd tags are coming in cute editor HTML

    1. If you input <p center?=""><strong><span>Gr. Level</span> </strong></p> into Cute Editor, Cute Editor will not clean it up automcatially for you.
     
    2. I don't think this kind of code is created by cute editor. Maybe it's created by MS Word.
     
     

    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

  •  11-07-2008, 12:00 PM 45516 in reply to 45492

    Re: Some wierd tags are coming in cute editor HTML

    Hi Adam,

                 Thanks for the reply.....

                 Here I am using a regular expression given by you for cleaning inline styles and css classes. It works great.

    private  string CustomCleanHTML(string html)
     
     {   
     
            return Regex.Replace(html, @"<([^>]*)(?:class|lang|style|size|face|[ovwxp]:\w+)=(?:'[^']*'|""[^""]*""|[^\s>]+)([^>]*)>","<$1$2>", RegexOptions.IgnoreCase);
       
     }
     
     But when this applies to following type of tags ( wierd but donno my users are putting this kind of dirty data)
     
    <p class="MsoNormal" style="margin: 0in 0in 0pt; align: "  center?="">
     
    This is observed in tables pasted from ms word.
     
     
    Now the above regular expression removes class and style but residues the following
     
    <p center?=""><strong><span>Gr. Level</span> </strong></p>
     
    Now this center?="" is causing the problem for us, becoz we should generate PDF out of this, and that is not able to understand.
     
    Can you give me  another regular expression which will clean up all the attributes of <p> tag ?  only for p tags.
     
     Final output I want is
     
            <p><strong><span>Gr. Level</span> </strong></p>
     
     
    Thanks in advance,
     
    I appreciate all your support to us.
     
    Rama
View as RSS news feed in XML