Skip to content

2.0.0

Compare
Choose a tag to compare
@brendt brendt released this 16 Apr 07:44
· 133 commits to main since this release
  • 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;
}