diff --git a/boiiiwd_package/src/library_tab.py b/boiiiwd_package/src/library_tab.py index dbd543c..70103de 100644 --- a/boiiiwd_package/src/library_tab.py +++ b/boiiiwd_package/src/library_tab.py @@ -646,8 +646,10 @@ class LibraryTab(ctk.CTkScrollableFrame): name_label.grid(row=0, column=0, columnspan=2, sticky="w", padx=20, pady=5) desc_threshold = 30 - shortened_description = f"{description[:desc_threshold]}... (View)" if len(description) > desc_threshold else description - shortened_description = re.sub(r'\n', '', shortened_description).strip() + shortened_description = re.sub(r'\n', '', description).strip() + shortened_description = re.sub(r'([^a-zA-Z0-9\s:().])', '', shortened_description) + shortened_description = f"{shortened_description[:desc_threshold]}... (View)"\ + if len(shortened_description) > desc_threshold else shortened_description description_lab = ctk.CTkLabel(info_frame, text=f"Description: {shortened_description}") description_lab.grid(row=1, column=0, columnspan=2, sticky="w", padx=20, pady=5) if len(description) > desc_threshold: diff --git a/boiiiwd_package/src/main.py b/boiiiwd_package/src/main.py index 5baebdc..1036d36 100644 --- a/boiiiwd_package/src/main.py +++ b/boiiiwd_package/src/main.py @@ -706,8 +706,10 @@ class BOIIIWD(ctk.CTk): name_label.grid(row=0, column=0, columnspan=2, sticky="w", padx=20, pady=5) desc_threshold = 30 - shortened_description = f"{description[:desc_threshold]}... (View)" if len(description) > desc_threshold else description - shortened_description = re.sub(r'\n', '', shortened_description).strip() + shortened_description = re.sub(r'\n', '', description).strip() + shortened_description = re.sub(r'([^a-zA-Z0-9\s:().])', '', shortened_description) + shortened_description = f"{shortened_description[:desc_threshold]}... (View)"\ + if len(shortened_description) > desc_threshold else shortened_description description_lab = ctk.CTkLabel(info_frame, text=f"Description: {shortened_description}") description_lab.grid(row=1, column=0, columnspan=2, sticky="w", padx=20, pady=5) if len(description) > desc_threshold: