Skip to content

Element gets wrapped in div when styles are applied #16

@nparashar150

Description

@nparashar150

Describe the issue
When a class is applied to an element, it gets wrapped in an additional div rather than appending the class directly to the element.

To Reproduce
Steps to reproduce the behavior:

  1. Use this input: > what **is** this?2. Compile to HTML.
    It outputs: <blockquote class="p-4 my-4 border-s-4 border-gray-300">what <strong>is</strong> this?</blockquote>

  2. Now use this input: ["[&>*>strong]:text-pink-500"] > what **is** this?
    It outputs: <div class="[&amp;>*>strong]:text-pink-500"><blockquote class="p-4 my-4 border-s-4 border-gray-300">what <strong>is</strong> this?</blockquote></div>

Expected behavior
The class should be applied directly to the blockquote, like this:
<blockquote class="p-4 my-4 border-s-4 border-gray-300 [&>*>strong]:text-pink-500">what <strong>is</strong> this?</blockquote>

Additional context
Avoid unnecessary wrapping in div when applying classes, and append the class to the target block-level element (e.g., blockquote) instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions