Report on new color markup ideas for moinmoin wiki, by Achin Sharma for google code in task.

NOTE: in the markups below the end of the 'tag' is being given by simple '[/]'. and not something like '[/color]' because every occurance would kill the closest tag following that the html is nested properly. The difference would be that [/color] could help in dealing with unclosed tags which in first case would cause havoc, by closing one step early, in a domino effect. But the codes are suppose to be dealt properly, if that error handling part can be overlooked then the first method should be used because that is simpler and shorter to type.

Recommendation 1

Comes From

BBcode.

Syntax

[color=red] red text [/] would give <span style="color:red"> red text </span>

similarly

[color=#f00] red text [/] would give <span style="color:#f00">red text </span>

For future reference, it could also be combined with other attributes like

[color=#f00; float=left;] red text [/]

I dont know python but this could be easily done with php :) infact something very similar is running on my own site.

PROS

CONS

Comments

While this doesn't usually conflict with other moin markup, [...] might be present in normal text.

But there might be even the rare case where this conflict with [[target]] markup - how we do know what's meant, what has priority then?

Also, other wikis use [] for (external) links.

Reply

Although all of your points are correct but it all depends on how you detect the syntax. Again, i would say that i dont know python but in php regex is a very simple solution which would pick up instances which have '[color=(.+)]' where (.+) part would be variable and the syntax would be applicable only and only if the non variable part exists in exact same way (case can obviously be overlooked). And a little search tells me that python also has regex support.

Although there is chance of [...] being there in normal text but then that is what the end tag [/] is for. They both being in same line in specific pattern will be more than just a coincidence. I would still stick to this recommendation.

Recommendation 2

Comes From

A slight variation in tiki.org. Original ~~red:This text is Red~~

Syntax

[red] red text [/] would give <span style="color:red"> red text </span>

similarly

[#f00] red text [/] would give <span style="color:#f00"> red text </span>

PROS

CONS

Comments

Agreed. Also this has even more likeliness to be found in normal text.

Recommendation 3

Comes From

MediaWiki.

Syntax

It is used by media wiki, one of the most used wiki cms on the web. it is use of html straight but with restricted attributes.

<span style="color:#f00"> red text </span>

PROS

CONS

Comments

A general problem with directly allowing html spans and trying to filter the bad stuff out of it is to recognize bad stuff (there are lots of ways to encode it).

Reply

Agreed but a simple approach would be instead of filtering the bad stuff, we can only allow the good stuff. That way we just have to approve 5 (for example) attributes which are safe (e.g title, class, id, and select attributes of style). It again comes to how we code all this.

Recommendation 4

Comes From

Moin table markup.

Syntax

This is similar to recommendation one, but it is here because same syntax has bee used in moin table markup. The user would not need to understand this if he is already familiar with the table markup.

<color=red> red text </> would give <span style="color:red"> red text </span>

PROS

CONS

Task Questions

Would it use css?

No

If so, how would css look like?

-

If not, why not?

It would use inline style.

MoinMoin: EasyToDo/Markup for Colour/submission (last edited 2010-12-05 23:37:43 by Achin)