mirror of https://github.com/scrapy/scrapy.git
fix minor error in IBL tests and post-processing nested annoations
This commit is contained in:
parent
bc6eee71e3
commit
407f7f2d65
|
|
@ -163,7 +163,7 @@ def safehtml(region, allowed_tags=_TAGS_TO_KEEP, replace_tags=_TAGS_TO_REPLACE):
|
|||
def _process_markup(region, textf, tagf):
|
||||
fragments = getattr(region, 'parsed_fragments', None)
|
||||
if fragments is None:
|
||||
textf(region)
|
||||
yield textf(region)
|
||||
return
|
||||
fiter = iter(fragments)
|
||||
for fragment in fiter:
|
||||
|
|
|
|||
|
|
@ -249,12 +249,12 @@ SL342
|
|||
Nice product for ladies
|
||||
<br/><ins data-scrapy-annotate="{"variant": 0, "generated": true,
|
||||
"annotations": {"content": "price"}}">
|
||||
£s;85.00
|
||||
£85.00
|
||||
</ins>
|
||||
</p>
|
||||
<ins data-scrapy-annotate="{"variant": 0, "generated": true,
|
||||
"annotations": {"content": "price_before_discount"}}">
|
||||
£s;100.00
|
||||
£100.00
|
||||
</ins>
|
||||
</body></html>
|
||||
"""
|
||||
|
|
@ -266,9 +266,9 @@ SL342
|
|||
<br/>
|
||||
Nice product for ladies
|
||||
<br/>
|
||||
£s;85.00
|
||||
£85.00
|
||||
</p>
|
||||
£s;100.00
|
||||
£100.00
|
||||
</body></html>
|
||||
"""
|
||||
|
||||
|
|
@ -812,9 +812,9 @@ TEST_DATA = [
|
|||
'special_partial_annotation', [ANNOTATED_PAGE11], EXTRACT_PAGE11, DEFAULT_DESCRIPTOR,
|
||||
{
|
||||
'name': [u'SL342'],
|
||||
'description': ['\nSL342\n \nNice product for ladies\n \n£s;85.00\n'],
|
||||
'price': [u'£s;85.00'],
|
||||
'price_before_discount': [u'£s;100.00'],
|
||||
'description': ['\nSL342\n \nNice product for ladies\n \n£85.00\n'],
|
||||
'price': [u'\xa385.00'],
|
||||
'price_before_discount': [u'\xa3100.00'],
|
||||
}
|
||||
),
|
||||
(# with ignore-beneath feature
|
||||
|
|
|
|||
Loading…
Reference in New Issue