1
0
mirror of https://github.com/h7x4/unofficial_jisho_api_dart.git synced 2025-01-22 01:14:45 +01:00

Fix definitionAbstract jquery loop

This commit is contained in:
Oystein Kristoffer Tveit 2020-06-22 14:26:11 +02:00
parent 5bbe5fb19a
commit 39c2eed084

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;
}