This patch makes MarkdownDecorator not include line breaks before and
after the `<pre>` and `<code>` tags that it adds to code blocks, since
this will be rendered as whitespace in the browser.
This patch fixes syntax highlighting for types and functions which names
begin with an underscore. Previously these entities would be treated as
plain text, but now they’re highlighted correctly as either types or
function calls.
This patch fixes syntax highlighting for when shorthand closure
arguments ($0, $1…) are interpolated into a string literal. The
fix is to no longer treat “$” as a delimiter, which should help
solve similar issues that might be encountered in the future as
well.
Splash was already capable of highlighting property wrappers, since
anything following an `@` symbol is treated as a keyword, but this
change adds a test that makes sure that it’ll keep working.
While Splash has supported iOS since its early days, this change makes
it possible to compile the iOS version as a Swift Package, using Xcode 11.
The changes require us to not make the assumption that != macOS == Linux.
(Also git ignore the new `.swiftpm` directory that SwiftPM now uses)
This patch makes Splash correctly highlight closure argument
shorthands (`$0`, `$1`, etc.), while also making the logic for
detecting a function call a bit simpler.
This makes Splash correctly highlight key paths that are passed as arguments
to a function, especially when there’s no external parameter label for that
argument.
This patch makes Splash correctly highlight nested closures marked with
the `@escaping` attribute. The fix is to start treating `@` like a proper
token, rather than as a delimiter.
- Add clarification that Splash is used on Swift by Sundell.
- Update installation instructions to reference Swift 4.2.
- Use more even dependency version.
This change adds a new command line tool to the Splash family:
`SplashMarkdown`.
It’s an adapted version of the tool that I’ve been using for months to
publish every article on Swift by Sundell, and works by replacing all
code blocks within a Markdown file.
Adding this will hopefully make Splash even easier to use, without the
need for writing custom tooling, or to manually replace each code block
within a Markdown file with a “splashed” version.
Swift 5 enables us to define custom ways to interpolate expressions into
strings, and Splash already successfully highlights that syntax, but let’s
add a test to make sure that continues to be the case.
This change makes Splash capable of highlighting Swift 5 raw strings,
although it’s currently limited to single line string literals. Support
for multi-line literals will be added in a future commit.
This change adds SwiftLint to the project. For now, the rules are tweaked
to match the current state of the code base — but will over time be changed
back to their defaults in several cases.
Some smaller changes (mostly related to code style) were applied to the
project to remove all warnings.
This change enables Splash to highlight multi-line comments that begin
with two asterisks, rather than just one. A test has also been added to
verify that documentation-style multi-line comments with an asterisk on
each line are also highlighted correctly.
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 adds support for three pre-processors that can appear in
function delcarations: `#file`, `#line` and `#function`. They’re not
highlighted as pre-processors, but rather as keywords, to match the
way Xcode treats them.
Normally, we don’t want Splash to contain too many special cases for
individual symbol names — but the `XCTAssert` family of functions are
so common that it warrants it. The problem is that Splash would currently
highlight those functions as types, since they are capitalized, which
has now been changed to function calls instead.
This patch makes Splash correctly highlight associated types within
protocol declarations. Like other declarations, typed declared using
the `associatedtype` keyword should not be highlighted.