-
Notifications
You must be signed in to change notification settings - Fork 60
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
[Request] Specifiy colors in text #88
Comments
I think this is generally a good idea and I can see the usefulness of it. However, I'm afraid of doing something like this because: I'd like to keep this open until enough people claim this should be a supported feature as I think it will open the door for a lot of complexity in the app. |
One suggestion: What about something similar with https://www.npmjs.com/package/markdown-it-attrs
|
That doesn't look bad actually... Maybe that's an alternative worth considering so we don't go down the html route. |
Definitely would love to see this. Especially if the colors could reference colors from the current theme. |
Is there a way to color just a word or section of words with the atters route? |
There's a mention of bracketed spans so something like this: |
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: ~~~markdown # <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](https://github.com/user-attachments/assets/fbd938da-4b78-46a0-ae90-cd8926cf4041) Fixes #88
This is fixed now, I ended up using |
I think it would be valuable to be able to specify colors for text, so that certain text elements could be emphasized.
I imagine it would be similar to how markdown is able to render it via html e.g.:
The text was updated successfully, but these errors were encountered: