Skip to content
New issue

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

Multiline class output fix #598

Closed

Conversation

funny-family
Copy link

🤔 What is the nature of this change?

  • New feature
  • Fix bug
  • Style optimization
  • Code style optimization
  • Performance optimization
  • Build optimization
  • Refactor code or style
  • Test related
  • Other

🔗 Related Issue

💡 Background or solution

📝 Changelog

Language Changelog
🇺🇸 English Fix multi line class output. Close issue: #569
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed (not needed)
  • Demo is updated/provided or not needed (not needed)
  • TypeScript definition is updated/provided or not needed (not needed)
  • Changelog is provided or not needed (need)

@netlify
Copy link

netlify bot commented Sep 16, 2022

Deploy Preview for vue-jsx-explorer ready!

Name Link
🔨 Latest commit d614773
🔍 Latest deploy log https://app.netlify.com/sites/vue-jsx-explorer/deploys/64943ff93626d90008e767fc
😎 Deploy Preview https://deploy-preview-598--vue-jsx-explorer.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@funny-family
Copy link
Author

@Amour1688 cc

@sxzz sxzz linked an issue Jun 22, 2023 that may be closed by this pull request
Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const App = () => (
  <div
    hello="a  b"
  >
    Hello World
  </div>
)

It should be hello: "a b"

packages/babel-plugin-jsx/src/transform-vue-jsx.ts Outdated Show resolved Hide resolved
Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use the same logic in transformJSXText from utils.ts.

Comment on lines +88 to +92
if (attributeValue?.type === 'StringLiteral') {
attributeValue.value = attributeValue.value
.trim()
.replace(/r?\n|\r/g, '');
}
Copy link
Member

@sxzz sxzz closed this in 8ed497d Jun 25, 2023
@sxzz
Copy link
Member

sxzz commented Jun 25, 2023

Thanks for the PR. We can directly use transformJSXText function 8ed497d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Multiline class outputs invalid js code
2 participants