update ui for alphabet text
This commit is contained in:
+10
-4
@@ -528,9 +528,7 @@
|
|||||||
const verses = Array.isArray(passage?.verses) ? passage.verses : [];
|
const verses = Array.isArray(passage?.verses) ? passage.verses : [];
|
||||||
|
|
||||||
return verses.reduce((totals, verse) => {
|
return verses.reduce((totals, verse) => {
|
||||||
const translationText = source?.features?.hasTokenAnnotations
|
const translationText = getVerseTranslationText(verse);
|
||||||
? buildTokenTranslationText(verse?.tokens, verse?.text)
|
|
||||||
: verse?.text;
|
|
||||||
const counts = getTextCounts(extractVerseCountText(verse, source, displayPreferences, translationText));
|
const counts = getTextCounts(extractVerseCountText(verse, source, displayPreferences, translationText));
|
||||||
|
|
||||||
totals.words += counts.words;
|
totals.words += counts.words;
|
||||||
@@ -1583,6 +1581,14 @@
|
|||||||
return glossText || String(fallbackText || "").trim();
|
return glossText || String(fallbackText || "").trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getVerseTranslationText(verse) {
|
||||||
|
const translationText = normalizeTextValue(verse?.text);
|
||||||
|
if (translationText) {
|
||||||
|
return translationText;
|
||||||
|
}
|
||||||
|
return buildTokenTranslationText(verse?.tokens, "");
|
||||||
|
}
|
||||||
|
|
||||||
function appendVerseTextLines(target, verse, source, displayPreferences, translationText, highlightQuery = "") {
|
function appendVerseTextLines(target, verse, source, displayPreferences, translationText, highlightQuery = "") {
|
||||||
if (!(target instanceof HTMLElement)) {
|
if (!(target instanceof HTMLElement)) {
|
||||||
return;
|
return;
|
||||||
@@ -1626,7 +1632,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createTokenVerse(verse, lexiconId, displayPreferences, source, options = {}) {
|
function createTokenVerse(verse, lexiconId, displayPreferences, source, options = {}) {
|
||||||
const translationText = buildTokenTranslationText(verse?.tokens, verse?.text);
|
const translationText = getVerseTranslationText(verse);
|
||||||
const verseCounts = getTextCounts(extractVerseCountText(verse, source, displayPreferences, translationText));
|
const verseCounts = getTextCounts(extractVerseCountText(verse, source, displayPreferences, translationText));
|
||||||
const isHighlighted = options.highlight !== false && isHighlightedVerse(verse);
|
const isHighlighted = options.highlight !== false && isHighlightedVerse(verse);
|
||||||
const article = document.createElement("article");
|
const article = document.createElement("article");
|
||||||
|
|||||||
Reference in New Issue
Block a user