HTML parser lowercases tag names that collide with native HTML elements (affects Svelte/Vue)

Đang mở
#382 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
html, typescript
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

Start by locating the @figma/code-connect/html tagged-template parser and trace where it lowercases native element names. Compare handling of Select and Textarea with TextField using the issue’s examples. Done means component names that collide with native HTML elements retain PascalCase in the generated output while native lowercase tags remain unchanged.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature request

Feature Request

The html tagged template from @figma/code-connect/html lowercases tag names that match native HTML elements (e.g., <Select>, <Textarea>), while custom element names like <TextField> preserve their PascalCase.

For frameworks like Svelte and Vue, <Select> and <select> are semantically different — the former is a component, the latter is a native element.

Current output: <select bind:value />
Desired output: <Select bind:value />

Note: Non-native tag names like <TextField> correctly preserve PascalCase.

Use Case

We use Code Connect with parser: "html" and label: "Svelte" for our Svelte 5 design system. Components named Select and Textarea display as native HTML elements in the Dev Mode code panel, which is confusing for developers.

Environment

  • @figma/code-connect v1.4.2
  • figma.config.json: { "parser": "html", "label": "Svelte" }
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của figma/code-connect

Tất cả issue của figma/code-connect

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.