Skip to content

Commit

Permalink
Revert "Strip HTML from Post Title when pasting (#35825)"
Browse files Browse the repository at this point in the history
This reverts commit 6d804a9.

# Conflicts:
#	package-lock.json
  • Loading branch information
getdave committed Oct 13, 2023
1 parent e21581b commit 0899a0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@wordpress/data": "file:../data",
"@wordpress/date": "file:../date",
"@wordpress/deprecated": "file:../deprecated",
"@wordpress/dom": "file:../dom",
"@wordpress/element": "file:../element",
"@wordpress/hooks": "file:../hooks",
"@wordpress/html-entities": "file:../html-entities",
Expand Down
8 changes: 2 additions & 6 deletions packages/editor/src/components/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
insert,
} from '@wordpress/rich-text';
import { useMergeRefs } from '@wordpress/compose';
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';

/**
* Internal dependencies
Expand Down Expand Up @@ -170,7 +169,7 @@ function PostTitle( _, forwardedRef ) {
( firstBlock.name === 'core/heading' ||
firstBlock.name === 'core/paragraph' )
) {
onUpdate( stripHTML( firstBlock.attributes.content ) );
onUpdate( firstBlock.attributes.content );
onInsertBlockAfter( content.slice( 1 ) );
} else {
onInsertBlockAfter( content );
Expand All @@ -180,10 +179,7 @@ function PostTitle( _, forwardedRef ) {
...create( { html: title } ),
...selection,
};
const newValue = insert(
value,
create( { html: stripHTML( content ) } )
);
const newValue = insert( value, create( { html: content } ) );
onUpdate( toHTMLString( { value: newValue } ) );
setSelection( {
start: newValue.start,
Expand Down

0 comments on commit 0899a0c

Please sign in to comment.