Reference pin style

This commit is contained in:
barsdeveloper
2022-09-20 17:37:01 +02:00
parent 4e715568fe
commit bf2c3ec939
7 changed files with 79 additions and 21 deletions

View File

@@ -1,6 +1,5 @@
import { html } from "lit"
import MouseIgnore from "../input/mouse/MouseIgnore"
import Utility from "../Utility"
import PinTemplate from "./PinTemplate"
/**
@@ -16,14 +15,12 @@ export default class IInputPinTemplate extends PinTemplate {
}
static stringFromInputToUE(value) {
return value
.replace(/(?=\n\s*)\n$/, "") // Remove trailing double newline
.replaceAll("\n", "\\r\n") // Replace newline with \r\n (default newline in UE)
}
static stringFromUEToInput(value) {
return value
.replaceAll(/(?:\r|(?<=(?:^|[^\\])(?:\\\\)*)\\r)(?=\n)/g, "") // Remove \r leftover from \r\n
.replace(/(?<=\n\s*)$/, "\n") // Put back trailing double newline