Releases: tempestphp/highlight
Releases · tempestphp/highlight
2.2.0
2.1.0
What's Changed
- Add diff as a language. by @timvandijck in #111
New Contributors
- @timvandijck made their first contribution in #111
Full Changelog: 2.0.4...2.1.0
2.0.4
Full Changelog: 2.0.3...2.0.4
2.0.3
Full Changelog: 2.0.2...2.0.3
2.0.2
Full Changelog: 2.0.1...2.0.2
2.0.1
Full Changelog: 2.0.0...2.0.1
2.0.0
Language
interface has two new methods:getName
andgetAliases
interface Language
{
+ public function getName(): string;
+ public function getAliases(): array;
…
}
BaseLanguage
is now abstractHighlighter::setLanguage
is renamed toHighlighter::addLanguage
and its signature was changed:
- public function setLanguage(string $name, Language $language): self
+ public function addLanguage(Language $language): self
- A new
TextLanguage
was added - Rename
WithPre
toWebTheme
data-lang
now also works forInlineTheme
- interface WithPre
+ interface WebTheme extends Theme
- Changes to
WebTheme
method signatures:
- public function preBefore(): string;
- public function preAfter(): string;
+ public function preBefore(Highlighter $highlighter): string;
+ public function preAfter(Highlighter $highlighter): string;
- Moved all CSS themes from
src/Themes
tosrc/Themes/Css
- Injections can now only return
ParsedInjection
. If you happen to have custom injections that return strings, then those strings can simply be wrapped within aParsedInjection
:return new ParsedInjection($content)
.
interface Injection
{
- public function parse(string $content, Highlighter $highlighter): string|ParsedInjection;
+ public function parse(string $content, Highlighter $highlighter): ParsedInjection;
}
- Return type of
Pattern::getTokenType()
changed fromTokenTypeEnum
toTokenType
interface Pattern
{
- public function getTokenType(): TokenTypeEnum;
+ public function getTokenType(): TokenType;
}
Highlighter::withGutter()
is now an immutable function- Support for PHP's property hooks
1.3.4
Full Changelog: 1.3.3...1.3.4