mirror of https://github.com/scrapy/scrapy.git
Modified Unquote adaptor to make use of the new unquote_markup function instead of remove_entities
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40538
This commit is contained in:
parent
ac7ecb7810
commit
70af2e8e1d
|
|
@ -1,5 +1,5 @@
|
|||
import re
|
||||
from scrapy.utils.markup import replace_tags, remove_entities
|
||||
from scrapy.utils.markup import replace_tags, unquote_markup
|
||||
from scrapy.item.adaptors import adaptize
|
||||
|
||||
def remove_tags(value):
|
||||
|
|
@ -29,8 +29,8 @@ def remove_root(value):
|
|||
class Unquote(object):
|
||||
"""
|
||||
Receives a list of strings, removes all of the
|
||||
entities the strings may have, and returns
|
||||
a new list
|
||||
CDATAs and entities (except the ones in CDATAs) the strings
|
||||
may have, and returns a new list.
|
||||
|
||||
Input: iterable with strings
|
||||
Output: list of strings
|
||||
|
|
@ -41,4 +41,4 @@ class Unquote(object):
|
|||
def __call__(self, value, keep=None):
|
||||
if keep is not None:
|
||||
self.keep = keep
|
||||
return [ remove_entities(v, keep=self.keep) for v in value ]
|
||||
return [ unquote_markup(v, keep=self.keep) for v in value ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue