Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted Span Tag Addition Inside SVG Tags #76

Open
Jaskaran2 opened this issue Aug 1, 2023 · 0 comments
Open

Unwanted Span Tag Addition Inside SVG Tags #76

Jaskaran2 opened this issue Aug 1, 2023 · 0 comments

Comments

@Jaskaran2
Copy link

Jaskaran2 commented Aug 1, 2023

@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.

@Jaskaran2 Jaskaran2 changed the title RedCloth add's span tag with caps class around capitalized words without an option for skipping this behaviour. RedCloth add's span tag around capitalized words inside svg tags. Aug 1, 2023
@Jaskaran2 Jaskaran2 changed the title RedCloth add's span tag around capitalized words inside svg tags. Unwanted Span Tag Addition Inside SVG Tags Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant