Browse Source

strip cs-hide-if and cs-show-if attributes before checking

pull/67/head
adam j hartz 1 month ago
parent
commit
7fe218f027
Signed by: hz <hartz@mit.edu> GPG Key ID: 5FDD2840E179AD62
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      catsoop/language.py

+ 2
- 2
catsoop/language.py View File

@@ -823,8 +823,8 @@ def handle_custom_tags(context, text):
FALSY = {"0", "false", "", "[]", "()", "set()", "{}"}
for t in tree.find_all(["div", "span", "p"]):
if (
t.get("cs-hide-if", "false").lower() not in FALSY
or t.get("cs-show-if", "true").lower() in FALSY
t.get("cs-hide-if", "false").lower().strip() not in FALSY
or t.get("cs-show-if", "true").lower().strip() in FALSY
):
t.extract()



Loading…
Cancel
Save