Language interface has two new methods: getName and getAliases
interface Language
{
+ public function getName(): string;
+ public function getAliases(): array;
…
}
BaseLanguage is now abstract
Highlighter::setLanguage is renamed to Highlighter::addLanguage and its signature was changed:
- public function setLanguage(string $name, Language $language): self
+ public function addLanguage(Language $language): self
- A new
TextLanguagewas added
- Rename
WithPre to WebTheme
data-lang now also works for InlineTheme
- 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 to src/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 a ParsedInjection: 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 from TokenTypeEnum to TokenType
interface Pattern
{
- public function getTokenType(): TokenTypeEnum;
+ public function getTokenType(): TokenType;
}