mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
\n at the end of the file (#18155)
This PR fixes a Haml pre-processing issue where a crash occurs if there is no trailing `\n` at the end of the file and the code before it was considered Ruby code. This happens in situations where Ruby code was used. E.g.: ``` - index = 0 - index += 1 ``` In this situation when we see the `-` on the second line, then we will find the whole indented block and parse it as Ruby code instead. The block ands at the last `\n`, but since we reach the end of the file, there is no `\n`. Right now we incorrectly reset the internal cursor to the last known `\n` position. This means that the `start` of the Ruby block will be _after_ the `end` of the Ruby block and the Haml parser will crash. To solve this, once we reach the end of the file, we don't reset the cursor to the wrong position. Fixes: https://github.com/tailwindlabs/tailwindcss/issues/17379#issuecomment-2910108646 ## Test plan 1. Added a regression test that did fail before the fix, and doesn't anymore
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
Discuss Tailwind CSS on GitHub
For chatting with others using the framework:
Join the Tailwind CSS Discord Server
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.
Description
Languages
JavaScript
90.6%
CSS
7.6%
HTML
1.7%