Skip to content

Commit

Permalink
Fix paragraph splits on RN (#8915)
Browse files Browse the repository at this point in the history
* Make sure regex is applied in multiple lines.

* Add entry point for React Native.
  • Loading branch information
SergioEstevao authored Aug 13, 2018
1 parent a5b6126 commit 751a2fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"dependencies": {
"@babel/runtime": "^7.0.0-beta.52",
"@wordpress/api-fetch": "file:../api-fetch",
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class RichText extends Component {
this.lastEventCount = event.nativeEvent.eventCount;
// The following method just cleans up any <p> tags produced by aztec and replaces them with a br tag
// This should be removed on a later version when aztec doesn't return the top tag of the text being edited
const openingTagRegexp = RegExp( '^<' + this.props.tagName + '>', 'gi' );
const closingTagRegexp = RegExp( '</' + this.props.tagName + '>$', 'gi' );
const openingTagRegexp = RegExp( '^<' + this.props.tagName + '>', 'gim' );
const closingTagRegexp = RegExp( '</' + this.props.tagName + '>$', 'gim' );
const contentWithoutRootTag = event.nativeEvent.text.replace( openingTagRegexp, '' ).replace( closingTagRegexp, '' );
this.lastContent = contentWithoutRootTag;

Expand Down

0 comments on commit 751a2fc

Please sign in to comment.