Ticket #1605 (closed defect: fixed)

Opened 6 years ago

Last modified 10 months ago

Preserve wiki formatting within colored text

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: ColorMacro
Severity: normal Keywords:
Cc: chris@charabaruk.com Trac Release: 0.11

Description

with current macro, when I tried like this

[[Color(white,blue,Research]]

It should change only color, I suppose. But it wasn't. Only changing the color is desirable without effecting any wiki formatting. Is is possbile to do this? Thank you very much.

Attachments

ColorMacro_1605.patch (2.1 kB) - added by framay on 10/19/11 11:00:55.
possible patch for this ticket
ColorMacro_1605_processor.patch (3.8 kB) - added by framay on 10/19/11 14:01:23.
another patch: it is now also usable as WikiProcessor
ColorMacro_1605_processor2.patch (4.3 kB) - added by framay on 10/20/11 15:39:18.
another patch, which have rewritten most of the plugins code
ColorMacro.py (3.8 kB) - added by framay on 10/20/11 15:39:58.
Python file, identical when merging with ColorMacro_1605_processor2.patch

Change History

10/16/08 11:27:33 changed by diroussel

That should be possible as the TracWikiMacros? page says we can do this:

  text = "whatever wiki markup you want, even containing other macros"
  # Convert Wiki markup to HTML, new style
  out = StringIO()
  Formatter(self.env, formatter.context).format(text, out)
  return Markup(out.getvalue())

10/18/08 21:58:08 changed by diroussel

05/22/11 23:48:43 changed by rjollos

  • summary changed from keeping all formattings and changing only colors to Preserve wiki formatting within colored text.

#7696 closed as a duplicate.

05/23/11 01:53:24 changed by anonymous

  • cc set to chris@charabaruk.com.

10/19/11 11:00:55 changed by framay

  • attachment ColorMacro_1605.patch added.

possible patch for this ticket

10/19/11 11:12:26 changed by framay

I uploaded a possible solution for this ticket. All simple Wiki formatting should work (like bold, italic, links to tickets, etc.). But it seems that no macros are working.

So this example is working with that patch:

[[Color(lime,None,wiki,This is ''just'' an '''simple''' test, for more info see #7696 or TitleIndex)]]

This example however is not working (it just prints "recent changes: [[RecentChanges(,3" in lime background):

[[Color(lime,None,wiki,recent changes: [[RecentChanges(,3)]])]]

10/19/11 14:01:23 changed by framay

  • attachment ColorMacro_1605_processor.patch added.

another patch: it is now also usable as WikiProcessor

10/19/11 14:09:01 changed by framay

I added another possible patch, which allows using it as processor. And in that you can use wiki processors and wiki formatting.

10/20/11 15:39:18 changed by framay

  • attachment ColorMacro_1605_processor2.patch added.

another patch, which have rewritten most of the plugins code

10/20/11 15:39:58 changed by framay

  • attachment ColorMacro.py added.

Python file, identical when merging with ColorMacro_1605_processor2.patch

10/26/11 16:03:53 changed by framay

I saw just now, that the functionality, which is provided by ColorMacro is already implemented as default in Trac, see http://trac.edgewall.org/wiki/WikiHtml#HowtoUseDivSpan. And using span- and div-macro is even more powerful.

08/04/12 06:39:49 changed by rjollos

  • owner changed from diroussel to rjollos.

(In [11892]): Fixes #1605, #5651,

  • Use Genshi to construct span element.
  • Removed padding around span element.
  • Format wiki to html, allowing wiki markup to be used as the text argument to the Color macro.

08/04/12 06:39:58 changed by rjollos

  • release changed from 0.10 to 0.11.
  • status changed from new to closed.
  • resolution set to fixed.

Add/Change #1605 (Preserve wiki formatting within colored text)




Change Properties
Action