Skip to content

Theme inline style formatting #5

Description

@JonKaric

I'm adding multiple theme support to my site with:

\Torchlight\Engine\CommonMark\Extension::setThemeResolver(function () {
    return [
        'light' => 'github-light',
        'dark' => 'olaolu-palenight',
    ];
});

This renders the inline styles with broken formatting on the <code> element, causing the styles not to work on the frontend, depending on how the browser handles the syntax.

background-color: #fff;
color: #24292e;;  /* Double semicolon */
--phiki-dark-background-color: #292D3E;
--phiki-dark-color: #BFC7D5--theme-selection-background: #e2e5e9; /* Missing semicolon after value */
--phiki-dark-theme-selection-background: #7580B850 /* Missing semicolon after value. Valid syntax since its the last one but could be part of the bug.*/

I'd expect this to render as:

background-color: #fff;
color: #24292e;
--phiki-dark-background-color: #292D3E;
--phiki-dark-color: #BFC7D5;
--theme-selection-background: #e2e5e9;
--phiki-dark-theme-selection-background: #7580B850;

Grammar/Language
N/A. Seems to happen on all languages.

PHP Version
8.5.3

Phiki Version
1.0.0

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions