Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support de-camelCasing JSX html attributes#55

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
blakef wants to merge1 commit intopreactjs:main
base:main
Choose a base branch
Loading
fromblakef:feature-attribute-transform

Conversation

@blakef
Copy link

Taken the list ofPreact supported attributes and transform these attributes when building the rendered string.

tconroy, gpoitch, developit, and talentlessguy reacted with thumbs up emojisenorcris and tconroy reacted with hooray emoji
Taken the list of Preact supported attributes[1] and transform theseattributes when building the rendered string.[1]https://github.com/developit/preact/blob/f717ee8e53248d75ff8c1a46966adeec295d339b/src/preact.d.ts#L547
Copy link
Contributor

@gpoitchgpoitch left a comment

Choose a reason for hiding this comment

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

Need to double check some of the attrs formatting. Noted a few, but there are some others.

spellCheck:'spell-check',
srcDoc:'src-doc',
srcLang:'src-lang',
srcSet:'src-set',
Copy link
Contributor

Choose a reason for hiding this comment

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

'srcset'

srcDoc:'src-doc',
srcLang:'src-lang',
srcSet:'src-set',
tabIndex:'tab-index',
Copy link
Contributor

Choose a reason for hiding this comment

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

'tabindex'

@developit
Copy link
Member

Hiya! Sorry for the delay in responding to PRs. I'm wondering about the size impact of this, versus using a regular expression transform likename.replace(/([A-Z])/,'-$1').toLowerCase().

@sventschui
Copy link
Member

@developit the RegEx approach would suffer from the issue of transformingtabIndex totab-index instead oftabindex.

Combining both with a list of html attributes that need the hyphen to be removed might be a way to go.

Any other ideas?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@gpoitchgpoitchgpoitch requested changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@blakef@developit@sventschui@gpoitch

[8]ページ先頭

©2009-2025 Movatter.jp