diff --git a/src/transliteration/domain/columns.ts b/src/transliteration/domain/columns.ts index 263811ddc..16d2f792e 100644 --- a/src/transliteration/domain/columns.ts +++ b/src/transliteration/domain/columns.ts @@ -59,7 +59,6 @@ export function lineAccFromColumns({ acc.addColumnToken( token, index, - isInLineGroup, showMeter, showIpa, updatePhoneticPropsContext(column.content, index, phoneticProps), @@ -72,7 +71,7 @@ export function lineAccFromColumns({ acc ) return acc - }, new LineAccumulator()) + }, new LineAccumulator(isInLineGroup)) } export function numberOfColumns(columns: readonly TextLineColumn[]): number { diff --git a/src/transliteration/ui/LineAccumulator.tsx b/src/transliteration/ui/LineAccumulator.tsx index 10a16b6ec..a34bc8197 100644 --- a/src/transliteration/ui/LineAccumulator.tsx +++ b/src/transliteration/ui/LineAccumulator.tsx @@ -56,8 +56,13 @@ export class LineAccumulator { private enclosureOpened = false private protocol: Protocol | null = null private isFirstWord = true + private isInLineGroup = false lemmas: string[] = [] + constructor(isInLineGroup?: boolean) { + this.isInLineGroup = isInLineGroup || false + } + getColumns(maxColumns: number): React.ReactNode[] { return this.columns.map((column: ColumnData, index: number) => ( @@ -87,7 +92,6 @@ export class LineAccumulator { pushToken( token: Token, index: number, - isInLineGroup = false, showMeter = false, showIpa = false, phoneticProps?: PhoneticProps, @@ -100,7 +104,7 @@ export class LineAccumulator { this.pushSeparator() } - const DisplayTokenComponent = isInLineGroup + const DisplayTokenComponent = this.isInLineGroup ? DisplayLineGroupToken : DisplayToken @@ -139,7 +143,6 @@ export class LineAccumulator { addColumnToken( token: Token, index: number, - isInLineGroup?: boolean, showMeter?: boolean, showIpa?: boolean, phoneticProps?: PhoneticProps, @@ -161,7 +164,6 @@ export class LineAccumulator { this.pushToken( token, index, - isInLineGroup, showMeter, showIpa, phoneticProps, diff --git a/src/transliteration/ui/line-tokens.tsx b/src/transliteration/ui/line-tokens.tsx index 2699c216d..cf51f4393 100644 --- a/src/transliteration/ui/line-tokens.tsx +++ b/src/transliteration/ui/line-tokens.tsx @@ -30,7 +30,6 @@ export function LineTokens({ index, false, false, - false, {}, highlightTokens.includes(index) ? ['highlight'] : [] )