Open stevepiercy opened 2 years ago
Here's another one. If I remove aria-label="Cancel"
, then it gets lexed.
```jsx
<button className="cancel" aria-label="Cancel" onClick={() => this.onCancel()}>
<Icon
name={clearSVG}
className="circled"
size="30px"
title={this.props.intl.formatMessage(messages.cancel)}
/>
</button>
@stevepiercy that's because it's broken syntax. In react the kebab-case becomes camelCase, so it should be ariaLabel="Cancel"
@tiberiuichim thank you! Fixed in #3077.
I think not... in fact I had problems in the past if used the CamelCase:
@sneridagh ok, so it's not broken syntax, just the lexer being unaware of things. Ok, TIL
A new release of jsx-lexer might have fixed this issue. I updated the lexer to lex aria-*
attributes.
I need to double-check for strings that contain '
.
I gave it a shot to check for '
as described at the top of the issue, but I have no idea how to modify the lexer to accept it in this context.
When I attempt to highlight the following code snippet using Sphinx, MyST, and jsx-lexer, Sphinx returns a warning:
WARNING: Could not lex literal_block as "jsx". Highlighting skipped.
FWIW, if I try
js
as the lexer, it also does not lex.We need to make a choice about sytnax highlighting for
jsx
.Originally posted by @stevepiercy in https://github.com/plone/volto/issues/3035#issuecomment-1030588839
Filed ticket upstream on 2024-11-07 in https://github.com/pygments/pygments/issues/2816.