Fix definitionAbstract jquery loop

This commit is contained in:
Oystein Kristoffer Tveit 2020-06-22 14:26:11 +02:00
parent 5bbe5fb19a
commit 39c2eed084
1 changed files with 6 additions and 1 deletions

View File

@ -363,8 +363,13 @@ List<String> getNotes(Element child) => child.text.split('\n');
String getMeaning(Element child) => child.querySelector('.meaning-meaning').text;
String getMeaningAbstract(Element child) {
final meaningAbstract = child.querySelector('.meaning-abstract');
if (meaningAbstract == null) return null;
for (var element in meaningAbstract.querySelectorAll('a')) {
element.remove();
}
child.querySelector('.meaning-abstract')?.querySelector('a')?.remove(); //TODO: Loop remove
return child.querySelector('.meaning-abstract')?.text;
}