Fix "this is not available in \1" messages in reference

This commit is contained in:
Gordon Williams 2025-09-10 09:45:07 +01:00
parent 85c48379f3
commit 5f0b776748

View File

@ -400,14 +400,14 @@ for jsondata in detail:
dprefix = "This is only available in ";
if re.match(r'^!defined\((.+?)\) && !defined\((.+?)\)$', d):
dprefix = "This is not available in ";
d = re.sub(r'^!defined\((.+?)\) && !defined\((.+?)\)$', r"defined(\\1) or defined(\\2)", d)
d = re.sub(r'^!defined\((.+?)\) && !defined\((.+?)\)$', r"defined(\1) or defined(\2)", d)
if re.match(r'^!defined\((.+?)\)$', d):
dprefix = "This is not available in ";
d = re.sub(r'^!defined\((.+?)\)$', r"defined(\\1)", d)
d = re.sub(r'^!defined\((.+?)\)$', r"defined(\1)", d)
d = re.sub(r'!defined\(', r"not defined(", d)
d = d.replace("||", " and ").replace("&&", " with ")
d = re.sub(r'defined\((.+?)\)', replace_with_ifdef_description, d)
d = re.sub(r'(.*)_COUNT>=(.*)', r"devices with more than \\2 \\1 peripherals", d)
d = re.sub(r'(.*)_COUNT>=(.*)', r"devices with more than \2 \1 peripherals", d)
desc.append("\n\n**Note:** "+dprefix+d);
html_description(desc, jsondata["name"])