Repository navigation
Fix invalid source map mapping on escaping before new line - #2169
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughWhen HTML escaping changes CSS output, ChangesCSS source-map mapping
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change addresses the invalid source-map warning, and no concrete remaining merge-blocking issue is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Do you have a real issue or it is just theoretical issue from LLM? |
It's a real one. I saw this warning in the nuxt dev console of my project (Nuxt 4.6, Vite 8.3.3, postcss 8.5.29 from Vite): It was caused by a comment inside a Vue SFC |
|
Thanks! The fix was released in 8.5.30. |
Port of upstream "Fix invalid source map mapping on escaping before new line (postcss#2169)", which repairs the SafeStringifier escaping of the previous commit. Upstream-Commit: 6c9bc73 Co-authored-by: Alex Ershov <[email protected]>
Fix #2168
When
SafeStringifier.escapeHTMLescapes the output, the whole string is passed to the builder with the node and notype.MapGeneratorthen adds both start and end mappings. The end mapping usescolumn - 2, which assumes the string ends with the node's last char. For Root, the string ends withraws.after, so\nthere givesgenerated.column: -1, andsource-map-jsprintsInvalid mapping.Now only the start is mapped. The source map is already coarse in this branch.
Summary by CodeRabbit