Log in

Font color, text align and other styles

  • 25 May '16

Markdown does not support styles, but it's not uncommon for a forum to have text styling. Have you though about implementing this?

Something like

<style color="red" align="center">My centered text in red</style>

Perhaps limit the color choices to only a few keywords.

I was thinking of adding this, so I'm just looking to see if you have any opinion on how this should work.

nitelyEsteban Castro Borsani
  • 1
  • 25 May '16

Sounds like a plugin. I never liked seen comments in random colors in other forums, I prefer uniformity I guess. Some are hard to read, depending on the font color and background color.

Unrelated, can you give this PR a second look when you have time?

  • 25 May '16

@nitely said:
Sounds like a plugin. I never liked seen comments in random colors in other forums, I prefer uniformity I guess. Some are hard to read, depending on the font color and background color.

Yeah I was thinking of using a limited palette of colors anyway. Are there plugins in Spirit? Haven't seen anything like that.

Unrelated, can you give this PR a second look when you have time?

Absolutely! Sorry I haven't got around to it yet. Will try to test it again in the weekend.

nitelyEsteban Castro Borsani
  • 4
  • 25 May '16

@alesdotio said:
Yeah I was thinking of using a limited palette of colors anyway. Are there plugins in Spirit? Haven't seen anything like that.

There are no plugins, but maybe this can be the first one

Extending markdown is hard, though. It's not possible to create new inline grammar (in core it is, but it would not for plugins), coz it requires to modify the text parser (I had to do that to add the "mentions" (@) grammar). By grammar I mean symbols with a special meaning like: >, *, **. See this issue. However, I think adding BBCode-like tags should be ok.

Is something like this what you have in mind?

Text, [style color=#123aaa]color, color everywhere[/style], more text.

# align would only work for block texts like this, not inline.
[style color=#123aaa align=center]
Multi
line
text
[/style]

# Mixin both, I'm not sure it's possible. But bold and italic grammars do work like this, so may be it is.
Text, [style color=#123aaa]Multi
line
text[/style], more text.
Reply