Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix couple nits in PPtxt #782

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/guiguts/tools/pptxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,14 @@ def weird_characters() -> None:
line_number = 1
for line in book:
# Get list of weirdos on this line. That means any character NOT in the regex.
weirdos_list = re.findall(r"[^A-Za-z0-9\s.,:;?!\\\-_—–=“”‘’\[\]\(\){}]", line)
weirdos_list = re.findall(r"[^A-Za-z0-9\s.,:;?!&\\\-_—–=“”‘’\[\]\(\){}]", line)
# Update dictionary with the weirdos from the line.
for weirdo in weirdos_list:
# Skip exceptions
# Thoughtbreak consists of 5 asterisks equally spaced,
# and indented by at least 3 spaces.
if weirdo == "*" and re.fullmatch(r" {3,}\*( {3,10}\*)\1\1\1", line):
continue
if weirdo in weirdos_lines_dictionary:
weirdos_lines_dictionary[weirdo].append(line_number)
else:
Expand Down