mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #1243 from omnivore-app/fix/ssml-to-speech-idx
Start at index 3, because the frontend starts two nodes above the backend
This commit is contained in:
commit
1671d62c14
1 changed files with 5 additions and 5 deletions
|
|
@ -228,9 +228,9 @@ export const htmlToSsmlItems = (
|
|||
}
|
||||
|
||||
const items: SSMLItem[] = []
|
||||
for (let i = 2; i < parsedNodes.length + 2; i++) {
|
||||
for (let i = 3; i < parsedNodes.length + 3; i++) {
|
||||
const textItems: string[] = []
|
||||
const node = parsedNodes[i - 2]
|
||||
const node = parsedNodes[i - 3]
|
||||
|
||||
if (TOP_LEVEL_TAGS.includes(node.nodeName) || hasSignificantText(node)) {
|
||||
const idx = i
|
||||
|
|
@ -342,10 +342,10 @@ export const htmlToSpeechFile = (htmlInput: HtmlInput): SpeechFile => {
|
|||
wordOffset += titleUtterance.wordCount
|
||||
}
|
||||
|
||||
// start at 2 to skip the #readability-content and #readability-page-1 elements
|
||||
for (let i = 2; i < parsedNodes.length + 2; i++) {
|
||||
// start at 3 to skip the #readability-content and #readability-page-1 elements
|
||||
for (let i = 3; i < parsedNodes.length + 3; i++) {
|
||||
const textItems: string[] = []
|
||||
const node = parsedNodes[i - 2]
|
||||
const node = parsedNodes[i - 3]
|
||||
|
||||
if (TOP_LEVEL_TAGS.includes(node.nodeName) || hasSignificantText(node)) {
|
||||
// use paragraph as anchor
|
||||
|
|
|
|||
Loading…
Reference in a new issue