8000 Unwanted Span Tag Addition Inside SVG Tags · Issue #76 · jgarber/redcloth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Unwanted Span Tag Addition Inside SVG Tags #76
Open
@Jaskaran2

Description

@Jaskaran2

@jgarber Are you aware of this issue? any quick-around you can suggest for this to get working?

Currently, the gem includes a behavior that automatically adds a span tag around capitalized words in the input text, which cannot be disabled. This behavior causes issues when the input includes content within svg tags, as it also adds the span tag inside the svg code.

For example, given the following input text:

* is a _shorthand syntax_ used to generate valid HTML
The resulting HTML output includes the span tag:

<ul>
  <li>is a <em>shorthand syntax</em> used to generate valid <span class="caps">HTML</span></li>
</ul>

The problem arises when there is an all-capitalized color hex code inside the svg tag. The gem adds a span tag around it, causing the SVG code to break. For instance, the original SVG code:

<svg>.......st2{fill:#15467A !important} .st3{fill:#FFFFFF !important} ........</svg>

Is transformed into:

<svg>....... .st2{fill:#15467A !important} .st3{fill:#<span class="caps">FFFFFF</span> !important} ........</svg>

This unintended addition of the span tag within the SVG code causes issues with its rendering.

We need to find a solution to disable this span tag addition for content within svg tags.

Please address this issue to ensure the proper functioning of the gem with SVG content.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0