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

feat: parse inline span tags and css color attributes in them #390

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

mfontanini
Copy link
Owner

This PR adds support to parse inline span html tags and the color and background-color CSS attributes in the style span tag attribute.

The color and background-color can have any #RRGGBB formatted color + any color like red, dark_red, etc, as used in themes.

For now this only supports "strict" mode in which any deviation from what's supported will raise an error. In another PR I will add a way to configure this flag so if you don't feel like erroring, you can disable it.

After this change, the following:

# <span style="color: black; background-color: yellow"> _hi_ </span> mom

Paragraphs can <span style="color: #ffff00">**mix** colors <span style="background-color: white">in any way</span>


* <span style="color: red">this is red</span>
* this has <span style="background-color: blue">blue background</span>

Renders as:

image

Fixes #88

@mfontanini mfontanini merged commit 12be307 into master Nov 10, 2024
6 checks passed
@mfontanini mfontanini deleted the feat/inline-html-colors branch November 10, 2024 23:23
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

Successfully merging this pull request may close these issues.

[Request] Specifiy colors in text
1 participant