Skip to content

Commit

Permalink
use plain search instead of regex SELECT_PATTERN
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar authored and miso-belica committed Oct 14, 2021
1 parent 923f4d2 commit 31935c2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions justext/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
DEFAULT_ENCODING = 'utf8'
DEFAULT_ENC_ERRORS = 'replace'
CHARSET_META_TAG_PATTERN = re.compile(br"""<meta[^>]+charset=["']?([^'"/>\s]+)""", re.IGNORECASE)
SELECT_PATTERN = re.compile(r'^select|\.select')
GOOD_OR_BAD = {'good', 'bad'}


Expand Down Expand Up @@ -254,7 +253,7 @@ def classify_paragraphs(paragraphs, stoplist, length_low=LENGTH_LOW_DEFAULT,
paragraph.cf_class = 'bad'
elif ('\xa9' in paragraph.text) or ('&copy' in paragraph.text):
paragraph.cf_class = 'bad'
elif SELECT_PATTERN.search(paragraph.dom_path):
elif 'select' in paragraph.dom_path:
paragraph.cf_class = 'bad'
elif length < length_low:
if paragraph.chars_count_in_links > 0:
Expand Down

0 comments on commit 31935c2

Please sign in to comment.