Update patterns for spoilering

This commit is contained in:
Alwinfy 2023-02-18 21:05:52 -05:00
parent a6b438dd76
commit 182b8fc617
No known key found for this signature in database
GPG key ID: 2CCB99445F0C949E
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python3
from sys import argv, stdout
from collections import namedtuple
from fnmatch import fnmatch
from html import escape
import json # codec
import re # parsing
@ -397,7 +398,8 @@ def get_format(out, ty, value):
raise ValueError("Unknown format type: " + ty)
def entry_spoilered(root_info, entry):
return entry.get("advancement", None) in root_info["spoilers"]
if "advancement" not in entry: return False
return any(fnmatch(entry["advancement"], pat) for pat in root_info["spoilers"])
def category_spoilered(root_info, category):
return all(entry_spoilered(root_info, ent) for ent in category["entries"])

View file

@ -394,7 +394,7 @@
</p>
</blockquote>
</div>
#SPOILER hexcasting:opened_eyes hexcasting:y_u_no_cast_angy hexcasting:enlightenment
#SPOILER hexcasting:opened_eyes hexcasting:y_u_no_cast_angy hexcasting:enlightenment hexcasting:lore/*
#DUMP_BODY_HERE
</body>
</html>