Skip to content

Commit

Permalink
Decode hmtl entities in placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
jahvi authored and aduth committed Mar 14, 2018
1 parent 817c0e0 commit d369943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion editor/components/default-block-appender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
import { compose } from '@wordpress/element';
import { getDefaultBlockName } from '@wordpress/blocks';
import { withContext } from '@wordpress/components';
import { decodeEntities } from '@wordpress/utils';

/**
* Internal dependencies
Expand All @@ -35,7 +36,7 @@ export function DefaultBlockAppender( {
return null;
}

const value = placeholder || __( 'Write your story' );
const value = decodeEntities( placeholder ) || __( 'Write your story' );

return (
<div
Expand Down
6 changes: 3 additions & 3 deletions editor/components/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import classnames from 'classnames';
*/
import { __ } from '@wordpress/i18n';
import { Component, compose } from '@wordpress/element';
import { keycodes } from '@wordpress/utils';
import { keycodes, decodeEntities } from '@wordpress/utils';
import { withSelect, withDispatch } from '@wordpress/data';
import { withContext, withFocusOutside } from '@wordpress/components';

Expand Down Expand Up @@ -76,8 +76,8 @@ class PostTitle extends Component {
className="editor-post-title__input"
value={ title }
onChange={ this.onChange }
placeholder={ placeholder || __( 'Add title' ) }
aria-label={ placeholder || __( 'Add title' ) }
placeholder={ decodeEntities( placeholder ) || __( 'Add title' ) }
aria-label={ decodeEntities( placeholder ) || __( 'Add title' ) }
onFocus={ this.onSelect }
onKeyDown={ this.onKeyDown }
onKeyPress={ this.onUnselect }
Expand Down

0 comments on commit d369943

Please sign in to comment.