locked
HtmlEditorExtender stripes out pre tag RRS feed

  • Question

  • User1570265326 posted

    Hello. I have coded my own quoting system since HtmlEditorExtender does not have a quote system. Or does it have?

    for quote, i am using pre tag. However, the latest HtmlEditorExtender in version 16.1.0 stripes out the pre tag. It just removes the part that contains pre tag.

    I mean like

    <pre><pre>CeFurkan: Wrote</pre>dsfsdfs</pre>

    This is removed at the client side before posting to the server. How can i allow this tag?

    I also tried with span class="myClass" and it removes class tag this time

    my settings are

    code behind

    htmlEditorExtender1.EnableSanitization = true;

    front code

    <ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender1" TargetControlID="txtMessageBody"
                        runat="server" DisplaySourceTab="True">
                        <Toolbar>
                            <ajaxToolkit:Undo />
                            <ajaxToolkit:Redo />
                            <ajaxToolkit:Bold />
                            <ajaxToolkit:Italic />
                            <ajaxToolkit:Underline />
                            <ajaxToolkit:StrikeThrough />
                            <ajaxToolkit:Subscript />
                            <ajaxToolkit:Superscript />
                            <ajaxToolkit:JustifyLeft />
                            <ajaxToolkit:JustifyCenter />
                            <ajaxToolkit:JustifyRight />
                            <ajaxToolkit:JustifyFull />
                            <ajaxToolkit:InsertOrderedList />
                            <ajaxToolkit:InsertUnorderedList />
                            <ajaxToolkit:CreateLink />
                            <ajaxToolkit:UnLink />
                            <ajaxToolkit:RemoveFormat />
                            <ajaxToolkit:SelectAll />
                            <ajaxToolkit:UnSelect />
                            <ajaxToolkit:Delete />
                            <ajaxToolkit:Cut />
                            <ajaxToolkit:Copy />
                            <ajaxToolkit:Paste />
                            <ajaxToolkit:BackgroundColorSelector />
                            <ajaxToolkit:ForeColorSelector />
                            <ajaxToolkit:FontNameSelector />
                            <ajaxToolkit:FontSizeSelector />
                            <ajaxToolkit:Indent />
                            <ajaxToolkit:Outdent />
                            <ajaxToolkit:InsertHorizontalRule />
                            <ajaxToolkit:HorizontalSeparator />
                        </Toolbar>
                    </ajaxToolkit:HtmlEditorExtender>
    
    

    And web config

    <ajaxControlToolkit useStaticResources="true" renderStyleLinks="false" htmlSanitizer="AjaxControlToolkit.HtmlEditor.Sanitizer.DefaultHtmlSanitizer, AjaxControlToolkit.HtmlEditor.Sanitizer" />

    Thursday, June 9, 2016 1:36 AM

Answers

  • User61956409 posted

    Hi CeOfFuture,

    is removed at the client side before posting to the server. How can i allow this tag?

    I also tried with span class="myClass" and it removes class tag this time

    I try to reproduce the issue using HtmlEditorExtender control v 16.1, the sample works fine, <pre> tag and elements’ class property do not be removed.

    Input

    Output

    Besides, you could try to set EnableSanitization property to false and test your sample to check if same issue will appear.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 10, 2016 7:56 AM