Skip to content

Commit

Permalink
see #1245: use html entity decoder to retain spaces and new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
naveen17797 committed Jan 4, 2021
1 parent e59320e commit cef00c1
Show file tree
Hide file tree
Showing 36 changed files with 61 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import he from 'he'
* @since 3.27.8
*/
export function filterPostContent( content ) {
// To prevent   and other special characters from appearing, we render it on placeholder
// element in dom and return the inner text
/**
* Note: we cant rely on innerText or textContent property as
* that would remove new lines, so we remove the tags manually,
* and use a html entity decoder to remove the html entities
*/
return he.decode( content.replace(/<[^>]+>/gi, "") );
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/dist/block-editor-faq-plugin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-polyfill', 'wp-rich-text'), 'version' => '63dfda35754528accf9a5de94d5280fc');
<?php return array('dependencies' => array('react', 'wp-polyfill', 'wp-rich-text'), 'version' => '089c2c9307297ea534f8d3b73730d894');
6 changes: 3 additions & 3 deletions src/js/dist/block-editor-faq-plugin.full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/block-editor-faq-plugin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/block-editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-rich-text'), 'version' => 'b4f240d73f3c338ceea22ae9ce0639f7');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-rich-text'), 'version' => 'c19de2407bb6463ac4ba2b6620b2b8a3');
8 changes: 4 additions & 4 deletions src/js/dist/block-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/bundle.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '225b8127ef5cd17a6b9a032eaa481c49');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'bf5337ee180c377562ca3ef660a1dac4');
2 changes: 1 addition & 1 deletion src/js/dist/bundle.full.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/js/dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/js/dist/edit.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-hooks', 'wp-polyfill'), 'version' => '0ebd73b5e93f9783d43e14e9d5567fc3');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-hooks', 'wp-polyfill'), 'version' => '00088288c3cfcb2e0c011b618ab82872');
10 changes: 5 additions & 5 deletions src/js/dist/edit.full.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/js/dist/edit.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/faq.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'e5bc56eec1a1beadadc4a36722e6a771');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '223a48c7a95598b7be783d35eaf137ae');
4 changes: 2 additions & 2 deletions src/js/dist/faq.full.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/js/dist/faq.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/mappings-edit.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'e7adefaa220fdf1d80285e2a9d93e507');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'a43031a26baeb28fa241b0d3ee56e965');
4 changes: 2 additions & 2 deletions src/js/dist/mappings-edit.full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/mappings-edit.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/mappings.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'f6433bb8067f4a1964c1d4923f8bb60e');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'c650a4dd270d01390cb85364498f2b20');
4 changes: 2 additions & 2 deletions src/js/dist/mappings.full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/mappings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/post-excerpt.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'ead90f89cb384a0401c6ba986bbb62c9');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '474b4c046b0976f60601fff151be397b');
12 changes: 6 additions & 6 deletions src/js/dist/post-excerpt.full.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/js/dist/post-excerpt.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/dist/term.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'e8b85b5883bb4fdb209dd6ceb5defe0d');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '8dfdad0958ba85701b2c6ffb8b34a3df');

0 comments on commit cef00c1

Please sign in to comment.