ambrosiogabe/MathAnimation

Add text formatting support

ambrosiogabe opened this issue · 0 comments

You should be able to format text inline with custom colors etc. Something like:

This is some text with <color = "blue">BLUE</color> text!!
This is some text with <i>ITALIC</i> text!
And this is some text with <bold><italic><color="yellow">multiple styles</color></italic></bold> on the text!!

Note that the formatting should support HTML style groups with the following:

  • Color group:
    • <color = CSS_STYLE_COLOR></color>
  • Italic group:
    • <i></i>
    • <italic></italic>
    • <italics></italics> # TODO: Should this be supported??
  • Bold group:
    • <b></b>
    • <bold></bold>
  • Underline group:
    • <underline></underline>
  • Strikethrough group:
    • <strikethrough></strikethrough>

Additional notes:

For group formatting (these things <></>):

  • It is case-insensitive
    • <b> == <B>
    • <bOlD> == <bold>
  • It is whitespace-insensitive (except for newlines)
    • < bold> == <bold> == < bold >
    • < bol
      d> != < bold>
    • All group openings must have a matching closing group
      • <bold><italic></italic> INVALID: No matching \</bold\>
    • Group openings/closing must respect order
      • <bold><italic> This is italic and bold</italic>, but this is just bold</bold> and this is not formatted
    • Group closing order must be the inverse of opening order
      • <bold><italic></italic></bold> OK: Close order matches open order bold -> italic <-> italic <- bold
      • <bold><italic></bold></italic> NOT OK: Close order is unmatched bold -> italic <-> bold <- italic

Any additional formatting rules will be written down here for documentation purposes. They will also be documented as part of this repositories documentation as they get added.