in Education by
Has anyone done this? Basically, I want to use the html by keeping basic tags such as h1, h2, em, etc; clean all non http addresses in the img and a tags; and HTMLEncode every other tag. I'm stuck at the HTML Encoding part. I know to remove a node you do a "node.ParentNode.RemoveChild(node);" where node is the object of the class HtmlNode. Instead of removing the node though, I want to HTMLEncode it. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You would need to remove the node representing the element you don't want. The encoded HTML would then need to be re-added as a text node. If you don't want to process the children of the elements that you want to throw away, you should be able to just use OuterHtml ... something like this might work: node.AppendChild(new HtmlTextNode { Text = HttpUtility.HtmlEncode(nodeToDelete.OuterHtml) });

Related questions

0 votes
    How do lean-thinking people and agile teams enable organizational agility?...
asked Nov 28, 2020 in Technology by JackTerrance
0 votes
    How do you focus a particular part of the HTML page in JavaScript? (a) hover() (b) focus() (c ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How is the Team and Technical Agility competency defined?...
asked Nov 27, 2020 in Technology by JackTerrance
0 votes
    Which two safe configurations are enough to achieve business agility?...
asked Nov 28, 2020 in Technology by JackTerrance
0 votes
    Enterprise Solution Delivery, Agile Product Delivery, and which other competency are part of the Execution side of the safe business agility overview?...
asked Nov 28, 2020 in Technology by JackTerrance
0 votes
    What is at the heart of Business Agility for SAFe 5.0?...
asked Nov 27, 2020 in Technology by JackTerrance
0 votes
    The Essential SAFe configuration does not enable Business Agility. Which three competencies are missing? (Choose three.)...
asked Nov 27, 2020 in Technology by JackTerrance
0 votes
    What is one characteristic of an Enterprise that has mastered strategy Agility?...
asked Nov 27, 2020 in Technology by JackTerrance
0 votes
    Change Fail rate is an Agility performance indicator. (1)False (2)True...
asked Oct 26, 2020 in Technology by JackTerrance
0 votes
    I am creating a web page where I have an input text field in which I want to allow only numeric ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I'm fairly new to Razor Components and I would like to change the title and other data inside the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I'm running Django 1.0 and I'm close to deploying my app. As such, I'll be changing the DEBUG ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    a) Harshita wants to create an HTML form. Which tag should she use to create this form? Her teacher has asked ... plz answer this fast Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    how can you insert some other html text file into your one html file? write the tag used for this purpose? Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
...