Fix sticky and text (#234)
This commit is contained in:
parent
8b3c963a08
commit
2fe646c2c7
2 changed files with 8 additions and 2 deletions
|
@ -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', {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue