This change makes Splash merge tokens of the same type (along with any
whitespace in between them) when generating HTML. The result is much
smaller HTML, since less tags have to be used to produce the same result.
This was most obvious with comment highlighting, for example, this comment:
```
// Hello I’m a comment
```
Would generate 5 different <span class="comment"></span> elements. Now
it’s just one!
This change makes it possible to implement custom token types, which is
really useful when building specialized grammars that use non-standard
token types.
This patch makes `HTMLOutputFormat` correctly escape all < and > characters
that occur in source code. Otherwise, a web browser rendering the resulting
HTML will interpret those characters as tags.
Now that the decision not to support colors on Linux
has been made, we can replace the custom `Color` struct
with simple typealiases for `NSColor` and `UIColor`.
The same can’t be done for font, since we want to enable
loading of a font from a path, for SPM packages.
Now that we’re making Splash support iOS as well as
Mac + Linux, we need to create some nice abstractions
to make sure that we can share as much code as possible
between all platforms.
- Define Font.Loaded and Color.Renderable as platform-
specific typealiases for system fonts and colors.
- Don’t compile in non-Linux compatible code when building
for Linux.
- Make Font and Color handle all conversion themselves, so
that AttributedStringOutputFormat can be kept more clean.