mirror of
https://github.com/h7x4/unofficial_jisho_api_dart.git
synced 2025-01-22 01:14:45 +01:00
Fix end symbol bug
This commit is contained in:
parent
0194e3a7a0
commit
510b27b802
@ -237,6 +237,11 @@ String uriForExampleSearch(String phrase) {
|
||||
return '${SCRAPE_BASE_URI}${Uri.encodeComponent(phrase)}%23sentences';
|
||||
}
|
||||
|
||||
String getEndSymbolsOfExampleSentence(Element ul) {
|
||||
final endSymbols = RegExp(r'<\/li>([^<>]+)$');
|
||||
return endSymbols.firstMatch(ul.innerHtml).group(1);
|
||||
}
|
||||
|
||||
ExampleResultData getKanjiAndKana(Element div) {
|
||||
final ul = div.querySelector('ul');
|
||||
final contents = ul.children;
|
||||
@ -277,6 +282,9 @@ ExampleResultData getKanjiAndKana(Element div) {
|
||||
}
|
||||
}
|
||||
}
|
||||
final endSymbols = getEndSymbolsOfExampleSentence(ul).trim();
|
||||
kanji+= endSymbols;
|
||||
kana += endSymbols;
|
||||
|
||||
return ExampleResultData(
|
||||
kanji: kanji,
|
||||
|
Loading…
Reference in New Issue
Block a user