(jsx) bug with parsing closing tags
See original GitHub issueHere’s the code snippet that doesn’t get highlighted at all:
import React, { Component, PropTypes } from 'react';
import Todo from './Todo';
export default class TodoList extends Component {
render() {
return (
<ul>
{this.props.todos.map((todo, index) =>
<Todo {...todo}
key={index}
onClick={() => this.props.onTodoClick(index)} />
)}
</ul>
);
}
}
TodoList.propTypes = {
onTodoClick: PropTypes.func.isRequired,
todos: PropTypes.arrayOf(PropTypes.shape({
text: PropTypes.string.isRequired,
completed: PropTypes.bool.isRequired
}).isRequired).isRequired
};
I can reproduce this with 8.8.0. Removing the JSX part makes the highlighting work again.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:11
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Parsing error: Expected corresponding JSX closing tag for ...
I faced strange bug in vscode...I'm creating an app with react.js.When I write code in js file , the tages are written correctly...
Read more >дэн al Twitter: "Finally, fixing Redux docs to use Prism instead of ...
(jsx) bug with parsing closing tags · Issue #931 · highlightjs/highlight.js. Here's the code snippet that doesn't get highlighted at all: import React, ......
Read more >JSX Self-closing tag not rendering - Codecademy Forums
In the exercise Animal Fun Fact I noticed that using a self-closing h1 does not render the text in the browser. While normal...
Read more >ValidateJavaScript - Online Tool to Find & Fix JavaScript Errors
... will automatically find basic errors and help prevent potentially destructive bugs in JavaScript & JSX (React.js) code. ... jsx-closing-tag-location
Read more >VS Code: You don't need that extension - Rob O'Leary
JavaScript: Auto Closing Tags : "Enable/disable automatic closing of JSX tags. Requires using TypeScript 3.0 or newer in workspace".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s 2017, is JSX support still not here?
Still not working, using the default highlight.js plugin inside a Gitbook:
Switching to Prism fixes it: