mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2025-12-16 13:05:53 +00:00
make last new line optional, closes #1258
This commit is contained in:
@@ -112,7 +112,9 @@ export function parseClipboard (clipboard: string): Result<ParsedItem, string> {
|
|||||||
|
|
||||||
function itemTextToSections (text: string) {
|
function itemTextToSections (text: string) {
|
||||||
const lines = text.split(/\r?\n/)
|
const lines = text.split(/\r?\n/)
|
||||||
|
if (lines[lines.length - 1] === '') {
|
||||||
lines.pop()
|
lines.pop()
|
||||||
|
}
|
||||||
|
|
||||||
const sections: string[][] = [[]]
|
const sections: string[][] = [[]]
|
||||||
lines.reduce((section, line) => {
|
lines.reduce((section, line) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user