Skip to content

Commit

Permalink
Debugging improvements. Bump to 0.6.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
buriy committed Jul 27, 2015
1 parent fcdbe56 commit 8ff11e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions readability/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def describe_node(node):
name = node.tag
if node.get('id', ''):
name += '#' + node.get('id')
if node.get('class', ''):
name += '.' + node.get('class').replace(' ', '.')
if node.get('class', '').strip():
name += '.' + '.'.join(node.get('class').split())
if name[:4] in ['div#', 'div.']:
name = name[3:]
if name in ['tr', 'td', 'div', 'p']:
Expand All @@ -27,7 +27,7 @@ def describe_node(node):
return name


def describe(node, depth=2):
def describe(node, depth=1):
global uids, uids_document
doc = node.getroottree().getroot()
if doc != uids_document:
Expand All @@ -37,8 +37,8 @@ def describe(node, depth=2):
#return repr(NodeRepr(node))
parent = ''
if depth and node.getparent() is not None:
parent = describe(node.getparent(), depth=depth - 1)
return parent + '/' + describe_node(node)
parent = describe(node.getparent(), depth=depth - 1) + '>'
return parent + describe_node(node)


RE_COLLAPSE_WHITESPACES = re.compile('\s+', re.U)
Expand Down
2 changes: 1 addition & 1 deletion readability/readability.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#'trimRe': re.compile('^\s+|\s+$/'),
#'normalizeRe': re.compile('\s{2,}/'),
#'killBreaksRe': re.compile('(<br\s*\/?>(\s|&nbsp;?)*){1,}/'),
'videoRe': re.compile('http:\/\/(www\.)?(youtube|vimeo)\.com', re.I),
'videoRe': re.compile('https?:\/\/(www\.)?(youtube|vimeo)\.com', re.I),
#skipFootnoteLink: /^\s*(\[?[a-z0-9]{1,2}\]?|^|edit|citation needed)\s*$/i,
}

Expand Down

0 comments on commit 8ff11e6

Please sign in to comment.