quizdown-js
quizdown-js copied to clipboard
Character `<` in code blocks causes failure
When I try to render a code block containing <, a failure occurs:
TypeError: Cannot read properties of undefined (reading 'items'). App could not render. Please check your quizdown syntax.
This is the full HTML page:
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/quizdown@latest/public/build/quizdown.js">
</script>
<script>quizdown.init();</script>
</head>
<body>
<div class="quizdown">
---
primaryColor: steelblue
shuffleQuestions: false
shuffleAnswers: true
---
### Select your superpowers!
```plaintext
Property<String>
```
- [ ] Enhanced Strength
- [ ] Levitation
- [x] Shapeshifting
</div>
</body>
</html>
When I remove the < character, the quiz renders fine.
< is a pretty common character in Java code (and probably other languages) so I expect this to be rendered successfully like other code.
I've noticed that when I use the Quizdown Editor, the same markup works without issue.