jsx-lexer
jsx-lexer copied to clipboard
Error while using javascript
I have code like this:
{% highlight jsx %}
function Pagination(props, children) {
var list = [];
var _class;
for (var i=0; i<props.size; i++) {
if (i == props.selected) {
_class = 'selected';
} else {
_class = '';
}
list.push(<li class={_class}>{i}</li>);
}
return (<ul>{list}</ul>);
}
{% endhighlight %}
and the output in jekyll blog post, look like this:

white with red have class "err".
The issue is that the lexer is parsing <props.size; as a Tag. If you write it as i < prop.size; it will be parsed correctly.
That said, if that's valid JSX (ie: if your bundler parses it correctly), jsx-lexer should support it.