From 71312e3532c179e9a2d08435710b39aafd96ba61 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 4 Dec 2024 10:04:07 +0000 Subject: [PATCH] Output the class attribute correctly in HTML --- packages/format-library/src/link/inline.js | 4 ++-- packages/format-library/src/link/utils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/format-library/src/link/inline.js b/packages/format-library/src/link/inline.js index 864f356d9436d3..741e1ed7d3f96f 100644 --- a/packages/format-library/src/link/inline.js +++ b/packages/format-library/src/link/inline.js @@ -97,10 +97,10 @@ function InlineLinkUI( { opensInNewTab: activeAttributes.target === '_blank', nofollow: activeAttributes.rel?.includes( 'nofollow' ), title: richTextText, - cssClasses: activeAttributes.className, + cssClasses: activeAttributes.class, } ), [ - activeAttributes.className, + activeAttributes.class, activeAttributes.id, activeAttributes.rel, activeAttributes.target, diff --git a/packages/format-library/src/link/utils.js b/packages/format-library/src/link/utils.js index ed379b3c4028db..4f64950efd457d 100644 --- a/packages/format-library/src/link/utils.js +++ b/packages/format-library/src/link/utils.js @@ -127,7 +127,7 @@ export function createLinkFormat( { const trimmedCssClasses = cssClasses?.trim(); if ( trimmedCssClasses?.length ) { - format.attributes.className = trimmedCssClasses; + format.attributes.class = trimmedCssClasses; } return format;