Zhomart / wikimodel

Automatically exported from code.google.com/p/wikimodel
0 stars 0 forks source link

Confluence: text effects #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Implement text effects markup as described here:
http://confluence.atlassian.com/renderer/notationhelp.action?section=texteffects

Original issue reported on code.google.com by mikhail....@gmail.com on 6 Apr 2009 at 1:53

GoogleCodeExporter commented 9 years ago
The following symbols are used as style switchers: "*" (bold), "_" (emphasis), 
"^"
(superscript), "~" (subscript). The same characters between two space symbols 
are
considered as special characters. So " * " DOES NOT considered as a bold 
switcher but
"titi" in  the "toto*titi*tata" pattern will be marked as strong. 

The symbols "-" and "+" are too common in the text and they are used in 
Confluence to
mark strikethrough and underline formmatings respectively (which are not 
commonly
used formattings). So to avoid recognition of "-" and "+" as formatter symbols 
in
patterns like "high-quality" the following rules was introduced:
 * "-" and "+" characters are reported as normal special symbols
 * (" -" | "- ") and (" +" | "+ ") patterns are used as style switchers

From the practical point of view it means that the following patters will NOT be
reported as formatted:
{{{
-it is NOT a strikethrough (there is no space at the beginning)
+it is NOT underlined text (there is no space at the beginning)
abc - cde ("-" symbol is between two spaces)
}}}

The following formatting works well:
{{{
abc -cde-
abc +cde+
}}}

Original comment by mikhail....@gmail.com on 6 Apr 2009 at 2:13

GoogleCodeExporter commented 9 years ago
Finally it was implemented by introducing the inline state representation in the
parser context. This state is explicitly checked when a new formatting symbol 
is found. 

Original comment by mikhail....@gmail.com on 6 Apr 2009 at 5:02