fix: punctuation symbols rendered separately
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { version } from '../../../../package.json'
|
import { version } from '../../../../package.json'
|
||||||
import { PUNCTUATION_LIST, ZERO } from '../../dataset/constant/Common'
|
import { ZERO } from '../../dataset/constant/Common'
|
||||||
import { RowFlex } from '../../dataset/enum/Row'
|
import { RowFlex } from '../../dataset/enum/Row'
|
||||||
import {
|
import {
|
||||||
IAppendElementListOption,
|
IAppendElementListOption,
|
||||||
@@ -88,6 +88,7 @@ import { EventBusMap } from '../../interface/EventBus'
|
|||||||
import { Group } from './interactive/Group'
|
import { Group } from './interactive/Group'
|
||||||
import { Override } from '../override/Override'
|
import { Override } from '../override/Override'
|
||||||
import { ImageDisplay } from '../../dataset/enum/Common'
|
import { ImageDisplay } from '../../dataset/enum/Common'
|
||||||
|
import { PUNCTUATION_REG } from '../../dataset/constant/Regular'
|
||||||
|
|
||||||
export class Draw {
|
export class Draw {
|
||||||
private container: HTMLDivElement
|
private container: HTMLDivElement
|
||||||
@@ -1781,7 +1782,7 @@ export class Draw {
|
|||||||
if (
|
if (
|
||||||
element.width ||
|
element.width ||
|
||||||
element.letterSpacing ||
|
element.letterSpacing ||
|
||||||
PUNCTUATION_LIST.includes(element.value)
|
PUNCTUATION_REG.test(element.value)
|
||||||
) {
|
) {
|
||||||
this.textParticle.complete()
|
this.textParticle.complete()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,3 +10,6 @@ export const UNICODE_SYMBOL_REG = new RegExp(
|
|||||||
`${EMOJI_REG.source}|${SURROGATE_PAIR_REG.source}`,
|
`${EMOJI_REG.source}|${SURROGATE_PAIR_REG.source}`,
|
||||||
'g'
|
'g'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export const PUNCTUATION_REG =
|
||||||
|
/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/
|
||||||
|
|||||||
Reference in New Issue
Block a user