Using the Color Macro on Wiki Links
|Reported by:||netjunki||Owned by:||mrelbe|
So I'm trying to create links that has a different color to have a feature like spoiler text as found on TvTropes... but applied to links.
I thought the obvious syntax would be something like:
[[Color([wiki:SandBox testing 1 2 3],white)]]
But this comes out as normal link color...
After some digging I now understand why... which is that the <a> tag generated for the link has a class of "wiki" defined which is overriding the <span> created by the color macro.
Is this something that can be fixed? Or is this just going to be a limitation of the macro? I tried a couple of things in the code... but ran into a different issue... but maybe I'm going about it the wrong way:
html = Markup(format_to_html(self.env, formatter.context, text).replace('class="wiki"',''))
This managed to remove the class definition... but introduced some paragraph elements... which broke things again... but maybe I'm missing something obvious (and I don't think what I did above is the right solution to this particular problem).