7.2.1
- 7.2.1 Jul 13 2017
- Fix some issues where style would not show up on tag, after being set
- 7.2.0 Jun 4 2017
-
Add ".forms" to AdvancedHTMLParser to emulate "document.forms" - returns all
"form" elements in a tag collection -
Update removeText to only remove the FIRST occurace of text (inline
with other javascript DOM functions). For old behaviour, see
removeTextAll which will remove all occurances of the text.
^^^ ^^^ ^^^ ^^^^ ^^^^ ^^
MAYBE BACKWARDS INCOMPATIBLE - depending on usage
-
Add removeTextAll function to remove all occuracnes of text from text
nodes on an element. -
Change removeText to return the old block (text in that node prior to
replace). removeTextAll returns a list of all old blocks. -
Add addBlock / addBlocks functions which take generic blocks (may be a
str, may be an AdvancedTag ). Returns the added block. -
Add removeBlock / removeBlocks functions which take generic blocks
(may be str, may be AdvancedTag). Returns the removed tag or the block
of text prior to remove. None on removeBlock if none found, or None in
the corrosponding element in the list return of removeBlocks -
Add removeChildren function as a helper to remove multiple children.
Returns the children removed in a list, with a "None" if that child
was not present. -
Add childBlocks method, to return both text nodes and tag nodes. This matches
what childNodes does in JS DOM (childNodes in AdvancedHTMLParser only returns
tags. Probably will be changed in a future version, such that .children
returns a TagCollection and childNodes returns all blocks.) -
Add isTextNode and isTagNode functions, to test if a block is a text node
(str) or a tag node (AdvancedTag) -
add "getChildBlocks" method which returns child blocks (same as childBlocks
property, but not a property) -
Update "insertAfter" and "insertBefore" methods:
- Now support blocks (text, or node)
- Now always return the child, not just when insertBefore/insertAfter was
NULL - Remove the actual insertion outside of the try/catch, as that error
should be raised (and should NEVER happen) - Cleanup documentation
- 7.1.0 May 21 2017
-
Add createElement function on AdvancedHTMLParser, to work like
document.createElement. Creates an element with the given tag name. -
Add createElementFromHTML function to parser which returns an AdvancedTag from given HTML
-
Add createElementsFromHTML function to parser which supports and returns a list of parsed
AdvancedTags (one or more). -
Add createBlocksFromHTML function to parser which parses HTML and returns a
list of blocks (either AdvancedTag objects, or text nodes (str). -
Add appendInnerHTML function to AdvancedTag which works like in javascript
tag.innerHTML += 'someOtherHTML'
and will parse and append any tags and/or text nodes -
Significant improvements in performance on creating tags ( On average, 125%
reduction in time to create an AdvancedTag. ) Use is also improved. -
Add "body" and "head" properties to Parser.AdvancedHTMLParser - to act same
as document.body and document.head -
Add method to both Parser and AdvancedTag, "getFirstElementCustomFilter",
which will apply a lambda/function on each tag, starting with first child and
all children, then second child and all children, etc.
This is used for finding things like "body" and "head" without needing to walk
through the whole document. It's also desgined to find them the quickest, as
they are very likely to be early and high-level objects in the tree.