Skip to content

Commit

Permalink
fix: inline text-color regex in edge-case when color slug ends with '…
Browse files Browse the repository at this point in the history
…-color' (#24621)
  • Loading branch information
abaicus authored Aug 25, 2020
1 parent b0e7281 commit 4b821c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/format-library/src/text-color/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export function getActiveColor( formatName, formatValue, colors ) {
}
const currentClass = activeColorFormat.attributes.class;
if ( currentClass ) {
const colorSlug = currentClass.replace( /.*has-(.*?)-color.*/, '$1' );
const colorSlug = currentClass.replace(
/.*has-([^\s]*)-color.*/,
'$1'
);
return getColorObjectByAttributeValues( colors, colorSlug ).color;
}
}
Expand Down

0 comments on commit 4b821c4

Please sign in to comment.