HtmlParser
TheArtOfDev.HtmlRenderer.Core.Parse
Methoden
AddTextBox(string, int, int, CssBox)
Add html text anon box to the current box, this box will have the rendered text Adding box also for text that contains only whitespaces because we don't know yet if the box is preformatted. At later stage they will be removed if not relevant.
- source
- the html source to parse
- startIdx
- the start of the html part
- tagIdx
- the index of the next html tag
- curBox
- the current box in html tree parsing
ExtractAttributes(string, int, int, Dictionary<string, string>)
Extract html tag attributes from the given sub-string.
- source
- the html source to parse
- idx
- the start index of the tag attributes in the source
- length
- the length of the tag attributes from the start index in the source
- attributes
- return the dictionary of tag attributes
ParseDocument(string) : CssBox
Parses the source html to css boxes tree structure.
- source
- the html source to parse
ParseHtmlTag(string, int, CssBox) : int
Parse the html part, the part from prev parsing index to the beginning of the next html tag.
- source
- the html source to parse
- tagIdx
- the index of the next html tag
- curBox
- the current box in html tree parsing
Rückgabe: the end of the parsed part, the new start index
ParseHtmlTag(string, int, int, string, Dictionary<string, string>) : bool
Parse raw html tag source to object. Extract attributes found on the tag.
- source
- the html source to parse
- idx
- the start index of the tag in the source
- length
- the length of the tag from the start index in the source
- name
- return the name of the html tag
- attributes
- return the dictionary of tag attributes
Rückgabe: true - the tag is closing tag, false - otherwise