question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we add `JSXText.raw`?

See original GitHub issue
require("meriyah").parse('<div>text</div>',{raw:true,jsx:true}).body[0].expression.children[0]
{ type: 'JSXText', value: 'text' }

babel has .extra.raw, flow/espree has .raw

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fiskercommented, Oct 28, 2020

I tested other parsers, so we have another problem, the value was wrong

<div>&nbsp;</div>

Should be {value: " ", raw: "&nbsp;"}

1reaction
fiskercommented, Oct 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Rendering raw html with reactjs - javascript - Stack Overflow
There are now safer methods to render HTML. I covered this in a previous answer here. You have 4 options, the last uses...
Read more >
How to Return Plain Text from a React Component | Pluralsight
In this short guide, we are going to explore how to return plain text from a React component and some alternatives.
Read more >
Introducing JSX - React
It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI...
Read more >
Portable Text to React - Sanity.io
A library to transform Portable Text to React components. ... You can pass an object of components to use, both to override the...
Read more >
Template Syntax | Vue.js
Raw HTML #. The double mustaches interpret the data as plain text, not HTML. In order to output real HTML, you will need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found