showmore works in the presence of pre tags (#344)

master
official-techsupport 2022-08-31 01:11:45 +03:00 committed by GitHub
parent 5f7df3fe66
commit 36c3cd60e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -91,8 +91,8 @@ reddit_domain_regex = re.compile("(^|\s|\()https?:\/\/(reddit\.com|new\.reddit.c
color_regex = re.compile("[a-z0-9]{6}", flags=re.A)
# lazy match on the {}?, only match if there is trailing text
showmore_regex = re.compile("^(.{3000,40000}?</p>)(<p>.*)", flags=re.A)
# lazy match on the {}?, only match if there is trailing stuff
showmore_regex = re.compile(r"^(.{3000,}?</p>)(\s*.+)", flags=re.A|re.DOTALL)
search_token_regex = re.compile('"([^"]*)"|(\S+)', flags=re.A)