Skip to content

Support formatted Vue Pug template tags - #20475

Open
cuishuang wants to merge 1 commit into
tailwindlabs:mainfrom
cuishuang:fix/vue-pug-template-attributes
Open

cuishuang wants to merge 1 commit into
tailwindlabs:mainfrom
cuishuang:fix/vue-pug-template-attributes

Conversation

@cuishuang

Copy link
Copy Markdown
Contributor

Summary

Vue files are passed through the Vue preprocessor, which detects <template lang="pug"> blocks and runs the Pug preprocessor on their contents.

The existing regular expression only matched the most compact opening tag form. It missed valid Vue template tags when lang had surrounding whitespace, when the opening tag spanned multiple lines, or when other attributes were present.

This change broadens the opening-tag detection while preserving the existing body replacement behavior. Pug preprocessing now works for formatted template tags and still ignores unrelated attributes such as data-lang.

Test plan

  • cargo test -p tailwindcss-oxide
  • rustfmt --check crates/oxide/src/extractor/pre_processors/vue.rs

All Oxide and scanner tests pass.

@cuishuang
cuishuang requested a review from a team as a code owner September 10, 2026 01:55
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 15c2fd50-b1bd-445c-a6e7-e4c67a9b1f37

📥 Commits

Reviewing files that changed from the base of the PR and between 2995898 and 485e278.

📒 Files selected for processing (1)
  • crates/oxide/src/extractor/pre_processors/vue.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Vue template extraction now accepts attributes before or after lang, flexible whitespace, and single- or double-quoted values. Quoted attribute contents, including > and lang-like text, do not end the opening tag or select Pug preprocessing. Capture handling reads the language and template body from updated capture groups. Tests cover these parsing cases and unquoted boolean-style attributes.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 485e2

The requested Vue template formats are covered by the change and its exact-output tests; no material merge-blocking issue was identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: support for formatted Vue Pug template tags.
Description check ✅ Passed The description explains the Vue template detection changes, supported formatting cases, preserved behavior, and test commands. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes Vue template tag parsing logic.

The PR appears safe to merge; the previous quoted-value false positive is fully addressed and no new actionable defects were found.

Reviews (2) · Last reviewed commit: "Support formatted Vue Pug template tags"

Comment thread crates/oxide/src/extractor/pre_processors/vue.rs Outdated
@cuishuang
cuishuang force-pushed the fix/vue-pug-template-attributes branch from 2995898 to 485e278 Compare September 30, 2026 22:06
@cuishuang

Copy link
Copy Markdown
Contributor Author

@RobinMalfait Could you please take a look when you have a chance? Thanks!

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.

1 participant