You are running into the html replacement issue for nested 'queries'. In this case the query in question is the kh formula. Check out the wiki for full details but the essence of it is that you need to replace the commas and end curly braces of your kh formula (not the attribute call though)... here is an example using the beginning of your code (I removed the () around the kh formula, they aren't required): [[?{Cure Level | Light, d8 + { 5 , @{LEVEL} } kh1| Moderate, ... etc etc