mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Make idx string type
This commit is contained in:
parent
3d11e9df8e
commit
6350a3d53e
2 changed files with 4 additions and 4 deletions
2
packages/api/src/textToSpeech.d.ts
vendored
2
packages/api/src/textToSpeech.d.ts
vendored
|
|
@ -12,7 +12,7 @@ declare module '@omnivore/text-to-speech-handler' {
|
|||
}
|
||||
|
||||
interface Utterance {
|
||||
idx: number
|
||||
idx: string
|
||||
wordOffset: number
|
||||
wordCount: number
|
||||
voice?: string
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { htmlToText } from 'html-to-text'
|
|||
// frontend code in: useReadingProgressAnchor
|
||||
|
||||
export interface Utterance {
|
||||
idx: number
|
||||
idx: string
|
||||
text: string
|
||||
wordOffset: number
|
||||
wordCount: number
|
||||
|
|
@ -248,7 +248,7 @@ export const htmlToSsmlItems = (
|
|||
|
||||
const htmlToUtterance = (
|
||||
tokenizer: WordPunctTokenizer,
|
||||
idx: number,
|
||||
idx: string,
|
||||
htmlItems: string[],
|
||||
wordOffset: number,
|
||||
voice?: string
|
||||
|
|
@ -289,7 +289,7 @@ export const htmlToSpeechFile = (
|
|||
const node = parsedNodes[i - 2]
|
||||
|
||||
if (TOP_LEVEL_TAGS.includes(node.nodeName) || hasSignificantText(node)) {
|
||||
const idx = i
|
||||
const idx = i.toString()
|
||||
i = emitElement(textItems, node, true)
|
||||
const utterance = htmlToUtterance(
|
||||
tokenizer,
|
||||
|
|
|
|||
Loading…
Reference in a new issue