markup icon indicating copy to clipboard operation
markup copied to clipboard

No longer possible to color text in Markdown

Open peterflynn opened this issue 12 years ago • 90 comments

Earlier, GFM allowed you to create colored text this way: <font color="red">Status: **Not yet implemented**</font>

That used to work. But at some point the <font> tag was removed from the HTML sanitization whitelist.

I suppose it got removed because it's deprecated in HTML5. (Aside: the color attribute is still on the whitelist. Should it be removed too? As far as I know, there's no other HTML tag it can be used on...)

So, can we have a new supported way of coloring text in sanitized GFM now?

Here's one possibility: allow a very strict use of style for setting colors. Only attributes that exactly match the form style="color: #xxxxxx" would be permitted. For something as constrained as that, you could enforce it with a simple regexp like ^color:\s*#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$.

peterflynn avatar Sep 17 '14 22:09 peterflynn

dont comment here. Its useless.

this issue is closed. I don't think github staff will be looking at your comments here. I suggest you comment here https://github.com/github/markup/issues/1440

ghost avatar Mar 06 '23 13:03 ghost

dont comment here. Its useless.

this issue is closed. I don't think github staff will be looking at your comments here. I suggest you comment here #1440

Frankly, I don't think commenting in the new issue is of much use either. They just couldn't care less, to stay polite.

patheticcockroach avatar Mar 06 '23 13:03 patheticcockroach

2023 and still waiting #### $\textcolor{red}{\textsf{Color didint work .}}$

Well, it does work now xD

kratofl avatar Aug 11 '23 21:08 kratofl

2023 and still waiting #### $\textcolor{red}{\textsf{Color didint work .}}$

Well, it does work now xD

finally!!!

JianqiangDing avatar Aug 13 '23 01:08 JianqiangDing

2023 and still waiting #### $\textcolor{red}{\textsf{Color didint work .}}$

$\textsf{{\color[rgb]{0.0, 0.0, 1.0}I}{\color[rgb]{0.1, 0.0, 0.9}t~ }{\color[rgb]{0.2, 0.0, 0.8}d}{\color[rgb]{0.3, 0.0, 0.7}o}{\color[rgb]{0.4, 0.0, 0.6}e}{\color[rgb]{0.5, 0.0, 0.5}s~ }{\color[rgb]{0.6, 0.0, 0.4}n}{\color[rgb]{0.7, 0.0, 0.3}o}{\color[rgb]{0.8, 0.0, 0.2}w}{\color[rgb]{0.9, 0.0, 0.1}!}{\color[rgb]{1.0, 0.0, 0.0}!}}$

Note, however, that it's still unselectable or searchable as text.

Hapaxia avatar Nov 16 '23 17:11 Hapaxia

Looks like, this turns off the syntax highlighting in <details>

$\textcolor{red}{\textsf{Colored summary}}$
- old line
+ new line

kunalspathak avatar Jan 08 '24 15:01 kunalspathak

WhatsApp hack karna he gf ka

kamilabbas8267-sketch avatar Dec 07 '25 19:12 kamilabbas8267-sketch

Image

kamilabbas8267-sketch avatar Dec 07 '25 19:12 kamilabbas8267-sketch

Note, however, that it's still unselectable or searchable as text.

Both work now! (only tested on Firefox) But after copying, every char has spaces in-between, which is weird

Rudxain avatar Dec 08 '25 19:12 Rudxain

More and more people would like the color text in Markdown...

Neustradamus avatar Apr 24 '26 10:04 Neustradamus