[2.0.0-beta2] The regex for attribute (values) props should allow all Tailwind allowed special characters

Created on 11 September 2024, 2 months ago
Updated 15 September 2024, 2 months ago

Problem/Motivation

We've fixed the issue with hyphens ("-") in both the attribute name and attribute value regex in : [2.0.0-beta2] The regex for attribute props should allow the hyphen ("-") symbol 🐛 [2.0.0-beta2] The regex for attribute props should allow the hyphen ("-") symbol Fixed

However, the attribute value regex should also allow other special characters used in Tailwind, to support classes like::

  • bg-blue-500
  • hover:bg-blue-500
  • w-1/2
  • w-1.5
  • text-[16px]
  • bg-[#ff5733]
  • [&_img]:rounded
  • [&_>p]:text-primary
  • [&_*]:bg-primary

Proposed resolution

Update attributes values regex from:

$double_quoted_value = '"[\s\w\-]*"';

to:

$double_quoted_value = '"[\s\w\-:&\#\[\]\/>\*\.]*"';
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇲🇦Morocco b.khouy 🇲🇦 Morocco

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024