Skip to content

Commit

Permalink
also search sub tags in collectElementService.js, #254
Browse files Browse the repository at this point in the history
  • Loading branch information
klues committed Mar 18, 2024
1 parent 27684f0 commit 3560868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/service/collectElementService.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ collectElementService.addWordFormTagsToLast = function (tags, toggle) {
lastElementCopy.wordFormTags = lastElementCopy.wordFormTags || [];
let currentLabel = getPrintTextOfElement(lastElementCopy);
lastElementCopy.wordFormTags = stateService.mergeTags(lastElementCopy.wordFormTags, tags, toggle);
let newLabel = stateService.getWordForm(lastElementCopy, {searchTags: lastElementCopy.wordFormTags});
let newLabel = stateService.getWordForm(lastElementCopy, {searchTags: lastElementCopy.wordFormTags, searchSubTags: true});
if (newLabel && newLabel !== currentLabel) {
collectedElements[collectedElements.length - 1] = lastElementCopy;
updateCollectElements();
Expand Down Expand Up @@ -456,7 +456,7 @@ function getOutputObject(element, options) {
text = i18nService.getTranslation(customSpeakAction.speakText, { forceLang: lang });
}
if (!text) {
let wordForm = stateService.getWordFormObject(element, {searchTags: element.wordFormTags, wordFormId: element.wordFormId}) || {};
let wordForm = stateService.getWordFormObject(element, {searchTags: element.wordFormTags, wordFormId: element.wordFormId, searchSubTags: true}) || {};
if (!options.dontIncludePronunciation) {
text = wordForm.pronunciation;
}
Expand Down

0 comments on commit 3560868

Please sign in to comment.