File tree Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 1+ # 2.0.4
2+
3+ - Fixed bug where pieces were missing in example sentences
4+ - Fixed bug where some scrapeForPhrase searches would crash for no apparent reason.
5+
16## 2.0.3
27
38- Bug fixes
Original file line number Diff line number Diff line change @@ -92,17 +92,18 @@ List<String> _getKanjiAndKana(Element div) {
9292 return [kanji, kana];
9393}
9494
95- Element normalizeSentenceElement (Element sentenceElement) =>
96- Element .html ('<ul>' +
97- sentenceElement.children.first.innerHtml.replaceAllMapped (
98- RegExp (r'(?<=^|<\/li>)\s*([^<>]+)\s*(?=<li)' ),
99- (match) =>
100- '<li class="clearfix"><span class="unlinked">${match .group (0 )}</span></li>' ,
101- ) +
95+ Element _normalizeSentenceElement (Element sentenceElement) =>
96+ Element .html ('<ul>'
97+ '${ sentenceElement .children .first .innerHtml .replaceAllMapped (
98+ RegExp (r'(?<=^|<\/li>)\s*([^<>]+)\s*(?=<li)' ),
99+ (match ) =>
100+ '<li class="clearfix"><span class="unlinked">${match .group (0 )}</span></li>' ,
101+ )}'
102102 '</ul>' );
103103
104+ // ignore: public_member_api_docs
104105List <ExampleSentencePiece > getPieces (Element sentenceElement) {
105- return normalizeSentenceElement (sentenceElement)
106+ return _normalizeSentenceElement (sentenceElement)
106107 .querySelectorAll ('li.clearfix' )
107108 .map ((var e) {
108109 final unlifted = assertNotNull (
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ PhrasePageScrapeResultData _getMeaningsOtherFormsAndNotes(
159159 var notes;
160160
161161 for (var child in meaningsWrapper.children) {
162- final mostRecentWordType = mostRecentWordTypes.length >= 1 ? mostRecentWordTypes[0 ] : null ;
162+ final mostRecentWordType = mostRecentWordTypes.isNotEmpty ? mostRecentWordTypes[0 ] : null ;
163163 if (child.className.contains ('meaning-tags' )) {
164164 mostRecentWordTypes = _getMostRecentWordTypes (child);
165165 } else if (mostRecentWordType == 'other forms' ) {
Original file line number Diff line number Diff line change 11name : unofficial_jisho_api
2- version : 2.0.3
2+ version : 2.0.4
33
44description : An unofficial api for searching and scraping the japanese dictionary Jisho.org
55homepage : https://github.com/h7x4ABk3g/unofficial_jisho_api_dart/
@@ -14,7 +14,7 @@ dependencies:
1414 html : ^0.15.0
1515
1616dev_dependencies :
17- pedantic : ^1.11 .1
17+ lints : ^1.0 .1
1818 test : ^1.17.10
1919 path : ^1.8.0
2020 effective_dart : ^1.3.2
You can’t perform that action at this time.
0 commit comments