Fix sticky and text (#234)

pull/258/head
Steve Ruiz 2021-11-10 12:07:01 +00:00 zatwierdzone przez GitHub
rodzic 8b3c963a08
commit 2fe646c2c7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -235,8 +235,11 @@ export class StickyUtil extends TLDrawShapeUtil<T, E> {
const PADDING = 16
const MIN_CONTAINER_HEIGHT = 200
const fixNewLines = /\r?\n|\r/g
const fixSpaces = / /g
function normalizeText(text: string) {
return text.replace(/\r?\n|\r/g, '\n')
return text.replace(fixNewLines, '\n').replace(fixSpaces, '\u00a0')
}
const StyledStickyContainer = styled('div', {

Wyświetl plik

@ -280,8 +280,11 @@ export class TextUtil extends TLDrawShapeUtil<T, E> {
const LETTER_SPACING = -1.5
const fixNewLines = /\r?\n|\r/g
const fixSpaces = / /g
function normalizeText(text: string) {
return text.replace(/\r?\n|\r/g, '\n')
return text.replace(fixNewLines, '\n').replace(fixSpaces, '\u00a0')
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any