Skip to content

Commit

Permalink
Fix content stripping due to Highlight block raw transform (#2563)
Browse files Browse the repository at this point in the history
fix the content stripping due to raw ransform logic
  • Loading branch information
AnthonyLedesma committed Aug 25, 2023
1 parent 1bf29ec commit 34b545a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/blocks/highlight/test/transforms.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ describe( 'coblocks/highlight transforms', () => {
expect( block.attributes.content ).toBe( content );
} );

it( 'should transform raw html to block', () => {
// This test is failing due to removal of raw transforms.
// The raw transforms no longer process the given HTML as expected.
it.skip( 'should transform raw html to block', () => {
const content = 'Lorem <strong>ipsum</strong> dolor sit amet.';
const HTML = `<p class="wp-block-coblocks-highlight"><mark>${ content }</mark></p>`;

Expand Down
14 changes: 0 additions & 14 deletions src/blocks/highlight/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Internal dependencies
*/
import metadata from './block.json';
import getPhrasingContentSchema from '../../utils/get-phrasing-content-schema';

/**
* WordPress dependencies
Expand All @@ -20,19 +19,6 @@ const transforms = {
} );
},
},
{
type: 'raw',
selector: 'p.wp-block-coblocks-highlight',
schema: {
p: {
children: {
mark: {
children: getPhrasingContentSchema(),
},
},
},
},
},
{
type: 'prefix',
prefix: ':highlight',
Expand Down
12 changes: 0 additions & 12 deletions src/utils/get-phrasing-content-schema.js

This file was deleted.

0 comments on commit 34b545a

Please sign in to comment.