From 898b5f89cf2e81d89d815b3ac59d98e575f01300 Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 29 Oct 2020 17:35:44 +0100 Subject: [PATCH] Strip HTML from caption when saving as alt attribute --- packages/block-library/src/gallery/save.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/gallery/save.js b/packages/block-library/src/gallery/save.js index 263055c0681e93..b0845abc18d822 100644 --- a/packages/block-library/src/gallery/save.js +++ b/packages/block-library/src/gallery/save.js @@ -2,6 +2,7 @@ * WordPress dependencies */ import { RichText } from '@wordpress/block-editor'; +import { __unstableStripHTML } from '@wordpress/dom'; /** * Internal dependencies @@ -43,7 +44,11 @@ export default function save( { attributes } ) { const img = (