Skip to content

Commit

Permalink
Site Editor: Fix error in compileStyleValue (#43116)
Browse files Browse the repository at this point in the history
* Site Editor: Fix error in compileStyleValue

* Use shorter alternative

Co-authored-by: Marin Atanasov <[email protected]>
  • Loading branch information
2 people authored and priethor committed Aug 12, 2022
1 parent cfcddb5 commit 0d5fcbc
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function compileStyleValue( uncompiledValue ) {
const VARIABLE_REFERENCE_PREFIX = 'var:';
const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
if ( uncompiledValue?.startsWith( VARIABLE_REFERENCE_PREFIX ) ) {

if ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {
const variable = uncompiledValue
.slice( VARIABLE_REFERENCE_PREFIX.length )
.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )
Expand Down

0 comments on commit 0d5fcbc

Please sign in to comment.