Add :smart :noref modes, update README
This commit is contained in:
@@ -11,6 +11,7 @@ from fnmatch import fnmatch
|
||||
import re
|
||||
import json
|
||||
|
||||
import lxml.etree
|
||||
import lxml.html
|
||||
|
||||
import feeds
|
||||
@@ -628,6 +629,16 @@ def After(rss, options):
|
||||
if not options.keep:
|
||||
del item.desc
|
||||
|
||||
if options.nolink and item.content:
|
||||
content = lxml.html.fromstring(item.content)
|
||||
for link in content.xpath('//a'):
|
||||
log(link.text_content())
|
||||
link.drop_tag()
|
||||
item.content = lxml.etree.tostring(content)
|
||||
|
||||
if options.noref:
|
||||
item.link = ''
|
||||
|
||||
if options.md:
|
||||
conv = HTML2Text(baseurl=item.link)
|
||||
conv.unicode_snob = True
|
||||
|
Reference in New Issue
Block a user