mirror of
https://github.com/h7x4/unofficial_jisho_api_dart.git
synced 2025-09-14 04:52:45 +02:00
Update version and lint
This commit is contained in:
@@ -92,17 +92,18 @@ List<String> _getKanjiAndKana(Element div) {
|
||||
return [kanji, kana];
|
||||
}
|
||||
|
||||
Element normalizeSentenceElement(Element sentenceElement) =>
|
||||
Element.html('<ul>' +
|
||||
sentenceElement.children.first.innerHtml.replaceAllMapped(
|
||||
RegExp(r'(?<=^|<\/li>)\s*([^<>]+)\s*(?=<li)'),
|
||||
(match) =>
|
||||
'<li class="clearfix"><span class="unlinked">${match.group(0)}</span></li>',
|
||||
) +
|
||||
Element _normalizeSentenceElement(Element sentenceElement) =>
|
||||
Element.html('<ul>'
|
||||
'${sentenceElement.children.first.innerHtml.replaceAllMapped(
|
||||
RegExp(r'(?<=^|<\/li>)\s*([^<>]+)\s*(?=<li)'),
|
||||
(match) =>
|
||||
'<li class="clearfix"><span class="unlinked">${match.group(0)}</span></li>',
|
||||
)}'
|
||||
'</ul>');
|
||||
|
||||
// ignore: public_member_api_docs
|
||||
List<ExampleSentencePiece> getPieces(Element sentenceElement) {
|
||||
return normalizeSentenceElement(sentenceElement)
|
||||
return _normalizeSentenceElement(sentenceElement)
|
||||
.querySelectorAll('li.clearfix')
|
||||
.map((var e) {
|
||||
final unlifted = assertNotNull(
|
||||
|
@@ -159,7 +159,7 @@ PhrasePageScrapeResultData _getMeaningsOtherFormsAndNotes(
|
||||
var notes;
|
||||
|
||||
for (var child in meaningsWrapper.children) {
|
||||
final mostRecentWordType = mostRecentWordTypes.length >= 1 ? mostRecentWordTypes[0] : null;
|
||||
final mostRecentWordType = mostRecentWordTypes.isNotEmpty ? mostRecentWordTypes[0] : null;
|
||||
if (child.className.contains('meaning-tags')) {
|
||||
mostRecentWordTypes = _getMostRecentWordTypes(child);
|
||||
} else if (mostRecentWordType == 'other forms') {
|
||||
|
Reference in New Issue
Block a user