7.2.3
- 7.2.3 - Sep 01 2017
- Work around some issues in python2 due to its piss-poor unicode implementation ( can be seen, for example, by using ↑ as a value in a tag ). For proper unicode support you should use python3, but this at least makes python2 more on-par with python3.
- 7.2.2 - Aug 07 2017
- Link through dot-access the "target" attribute on anchor "a" tags, and "selected" for option "option" tags.
I.e. this code:
optionEm = document.createElement('option')
optionEm.selected = True
Will mark the "selected" attribute of the option. And
someEm = document.getElementsByTagName('a')[0]
someEm.target = '_blank'
Will set the "target" tag attribute on "someEm"
-
Make "selected" a binary attribute, so it can only hold True or False, and is just listed as "selected" on a tag, per proper html. This makes it handle the same was as "checked" attribute
-
Some minor cleanups to the RST readme
- 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