Official color plugin not working


(Charles-Pierre) #1

####Steps to reproduce

####Expected behavior

[color=red]foo[/color]should be rendered with the word foo in red.

####Actual behavior

The word foo is rendered in black (but the bbcode color tags are actually stripped).

Here’s what I have on my install; as you can see, the div/span block is cooked, but the style attributes are nowhere to be seen.

Comment

There must have been some breaking changes to the plugin API, but I couldn’t find anything suspicious using git log.


Official color plugin not working again
(cpradio) #2

This is likely broken because of
https://meta.discourse.org/t/classes-are-not-being-sanitized-in-cooked-markdown/17367?source_topic_id=17539


(Sam Saffron) #3

@neil this is your plugin :slight_smile: needs to be updated to whitelist the colors.

see markdown.js for examples

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/markdown.js#L256-L257


(Charles-Pierre) #4

Actually, the situation seems to be worse than that since the [u][/u] tag doesn’t work either.

It doesn’t work on my fresh install or here on meta.
See screencap:

I also tried whitelisting the colors myself (in the plugin file, not in markdown.js), but to no avail.


(Neil Lalonde) #5

I’ll update this soon-ish. I don’t know about the [u] breakage though.


(Robin Ward) #7

No need to tag him, I fixed it this morning:

https://github.com/discourse/discourse/commit/186ce78cb578fc03ffc3b6afd95c873f33119148


Need help with Dialect emitter
(Jeff Atwood) #8