Skip to content
Deane Barker edited this page May 24, 2018 · 7 revisions

Do not edit this page! It is auto-generated by reflecting the Denina assembly, and changes will be over-written. To modifiy this documentation, the documentation attributes of the filters should be modified. See Embedded Documentation for more information.

Filter Purpose:
Creating and manipulating HTML strings.


Extract

Extracts an element from an HTML string.

Arguments

Name Required Description
path true The AngleSharp selector (very CSS like).

Samples

Input
<html>
    <body>
        <div id="a">James Bond</div>
    </body>
</html>
Command
Html.Extract -path:div#a
Output
James Bond

Strip

Strips tags from the HTML string.)

Samples

Input
James <b>Bond</b>.
Command
Html.StripTags
Output
James Bond.

Wrap

Wraps the input string in a specified HTML tag with optional class and/or ID.

Arguments

Name Required Description
tag true The name of the HTML tag in which to wrap the content.
class false If provided, the tag will use this as a "class" attribute.
id false If provided, the tag will use this as an "id" attribute.

Samples

Input
James Bond
Command
Html.Wrap -tag:div -class:spy -id:agent
Output
<div id="spy" class="agent">James Bond</div>

LineBreaks

Replaces line breaks with the corresponding HTML tag.

Samples

Input
James
Bond
Command
Html.LineBreaks
Output
James<br/>Bond

MakeTag

Creates an arbitrary HTML tag from supplied data.

Arguments

Name Required Description
tag true The name of the tag.
content false The content of the tag. If not supplied, the input text will be used.
* false All arguments other than "tag" and "content" will be converted to HTML attributes of the same name and value.

Samples

Input None
Command
Html.MakeTag -tag:div -content:"James Bond" -data-number:007
Output
<div data-number="007">James Bond</div>

SetAttribute

Set a specific attribute on a tag.

Arguments

Name Required Description
path true The path to the tag.
attribute true The name of the attribute to set.
val true The new value of the attribute.

Samples

Input
<div data-number="006">James Bond</div>
Command
Html.SetAttribute -path:div -attribute:data-number -value:007
Output
<div data-number="007">James Bond</div>

Clone this wiki locally