Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paragraph splits on RN #8915

Merged
merged 2 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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