Home / Function/ test_haml_pre_processor() — tailwindcss Function Reference

test_haml_pre_processor() — tailwindcss Function Reference

Architecture documentation for the test_haml_pre_processor() function in haml.rs from the tailwindcss codebase.

Entity Profile

Relationship Graph

Source Code

crates/oxide/src/extractor/pre_processors/haml.rs lines 352–399

    fn test_haml_pre_processor() {
        for (input, expected) in [
            // Element with classes
            (
                "%body.flex.flex-col.items-center.justify-center",
                "%body flex flex-col items-center justify-center",
            ),
            // Plain element
            (
                ".text-slate-500.xl:text-gray-500",
                " text-slate-500 xl:text-gray-500",
            ),
            // Element with hash attributes
            (
                ".text-black.xl:text-red-500{ data: { tailwind: 'css' } }",
                " text-black xl:text-red-500  data: { tailwind: 'css' }  ",
            ),
            // Element with a boolean attribute
            (
                ".text-green-500.xl:text-blue-500(data-sidebar)",
                " text-green-500 xl:text-blue-500 data-sidebar ",
            ),
            // Element with interpreted content
            (
                ".text-yellow-500.xl:text-purple-500= 'Element with interpreted content'",
                " text-yellow-500 xl:text-purple-500  'Element with interpreted content'",
            ),
            // Element with a hash at the end and an extra class.
            (
                ".text-orange-500.xl:text-pink-500{ class: 'bg-slate-100' }",
                " text-orange-500 xl:text-pink-500  class: 'bg-slate-100'  ",
            ),
            // Object reference
            (
                ".text-teal-500.xl:text-indigo-500[@user, :greeting]",
                " text-teal-500 xl:text-indigo-500 @user, :greeting ",
            ),
            // Element with an ID
            (
                ".text-lime-500.xl:text-emerald-500#root",
                " text-lime-500 xl:text-emerald-500 root",
            ),
            // Dots in strings in HTML attributes stay as-is
            (r#"<div id="px-2.5"></div>"#, r#"<div id "px-2.5"></div>"#),
        ] {
            Haml::test(input, expected);
        }
    }

Domain

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free