Skip to content

Commit

Permalink
Post Title: fix special chars (#18616)
Browse files Browse the repository at this point in the history
This commit ensures setting rightly of the title content.
  • Loading branch information
retrofox authored Nov 19, 2019
1 parent 33ea2e4 commit c21dbfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/editor/src/components/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import Textarea from 'react-autosize-textarea';
import classnames from 'classnames';
import { get } from 'lodash';
import { get, escape, unescape } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -123,7 +123,7 @@ class PostTitle extends Component {
<Textarea
id={ `post-title-${ instanceId }` }
className="editor-post-title__input"
value={ title }
value={ unescape( title ) }
onChange={ this.onChange }
placeholder={ decodedPlaceholder || __( 'Add title' ) }
onFocus={ this.onSelect }
Expand Down Expand Up @@ -181,7 +181,7 @@ const applyWithDispatch = withDispatch( ( dispatch ) => {
insertDefaultBlock( undefined, undefined, 0 );
},
onUpdate( title ) {
editPost( { title } );
editPost( { title: escape( title ) } );
},
onUndo: undo,
onRedo: redo,
Expand Down

0 comments on commit c21dbfe

Please sign in to comment.