0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Use RegEx for text.split

This commit is contained in:
G.Ambatte
2022-05-29 15:31:57 +12:00
parent 03bcbee1fc
commit 7b2486e411

View File

@@ -208,7 +208,7 @@ const Editor = createClass({
}
}
const textSplit = this.props.renderer == 'V3' ? `/^\\page$/gm` : '\\page';
const textSplit = this.props.renderer == 'V3' ? /^\\page$/gm : /\\page/;
const textString = this.props.brew.text.split(textSplit).slice(0, currentPage-1).join(textSplit);
const textPosition = textString.length;
const lineCount = textString.match('\n') ? textString.slice(0, textPosition).split('\n').length : 0;