mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 04:55:10 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
81b513c720
2 changed files with 6 additions and 1 deletions
|
|
@ -335,8 +335,8 @@ def _scrape_strip_cruft(html, plain_text_out=False):
|
|||
html = re.sub(r'<(script).*?</\1>(?s)', '', html) # Strip script tags.
|
||||
|
||||
if plain_text_out: # Strip remaining HTML tags
|
||||
html = TAG_RE.sub('', html)
|
||||
html = COMMENT_RE.sub('', html)
|
||||
html = TAG_RE.sub('', html)
|
||||
|
||||
# Strip lines
|
||||
html = '\n'.join([x.strip() for x in html.strip().split('\n')])
|
||||
|
|
|
|||
|
|
@ -148,6 +148,11 @@ class LyricsPluginTest(unittest.TestCase):
|
|||
self.assertEqual(lyrics._scrape_strip_cruft(text, True),
|
||||
"foobaz")
|
||||
|
||||
def test_scrape_strip_tag_in_comment(self):
|
||||
text = u"""foo<!--<bar>-->qux"""
|
||||
self.assertEqual(lyrics._scrape_strip_cruft(text, True),
|
||||
"fooqux")
|
||||
|
||||
def test_scrape_merge_paragraphs(self):
|
||||
text = u"one</p> <p class='myclass'>two</p><p>three"
|
||||
self.assertEqual(lyrics._scrape_merge_paragraphs(text),
|
||||
|
|
|
|||
Loading…
Reference in a new issue