We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Details
Traced this issue down to attrs and this area in particular;
attrs
let attrValue = object[key]; if (replaceQuote) { attrValue = object[key].replace(/"/g, '"'); } attr += ' ' + key + '="' + attrValue + '"';
Example
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="app" data-config="{ "title": "This is a test" }"></div> <script src="/parcel-test.e31bb0bc.js"></script> </body> </html>
Reproduction (Code)
package.json
{ "name": "parcel-test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "watch": "parcel index.html --out-dir build" }, "author": "", "license": "ISC", "dependencies": { "parcel": "^1.12.4", "react": "^17.0.1", "react-dom": "^17.0.1" } }
index.js
import React from 'react'; import ReactDOM from 'react-dom'; const root = document.getElementById('app'); const config = JSON.parse(root.dataset.config); const App = ({config}) => { return <h1>{config.title}</h1> } ReactDOM.render(<App config={config} />, root);
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="app" data-config='{ "title": "This is a test" }'></div> <script src="./index.js"></script> </body> </html>
Run the example
$ npm run watch
The text was updated successfully, but these errors were encountered:
Hi, thanks for your feedback.
There is an option that prohibits overwriting quotes https://github.com/posthtml/posthtml-render#replacequote she is just about your case
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Details
Traced this issue down to
attrs
and this area in particular;Example
Reproduction (Code)
package.json
index.js
index.html
Run the example
The text was updated successfully, but these errors were encountered: