PeachBrackets

PeachBrackets.Building.DocumentNode

DocumentNode.AppendHtmlFragment(string, StyleSheet, Func<HtmlFragmentSlot,DocumentNode,bool>) Method

Parses an HTML fragment and puts what it makes inside a new block child, styled by styleSheet and the fragment’s own <style> elements. A <slot> element in the fragment is a hole the caller fills.

public PeachBrackets.Building.DocumentNode AppendHtmlFragment(string html, PeachBrackets.Building.StyleSheet? styleSheet=null, System.Func<PeachBrackets.Building.HtmlFragmentSlot,PeachBrackets.Building.DocumentNode,bool>? fillSlot=null);

Parameters

html System.String

the fragment’s HTML

styleSheet StyleSheet

the rules the fragment is styled with, or null for the built-in defaults; it is not changed

fillSlot System.Func<HtmlFragmentSlot,DocumentNode,System.Boolean>

called for each <slot>, with its name and attributes and a node to build its replacement into; returns whether anything was built there (if not, the slot’s own fallback content stays). Null leaves every slot as it is.

Returns

DocumentNode
the block that holds the fragment