| 635 | } |
| 636 | |
| 637 | function collectHomeUpdateArticles(section) { |
| 638 | var updateHeadings = ['最近更新', 'Recent Updates']; |
| 639 | var updateList = Array.from(section.querySelectorAll('h2')).reduce(function (found, heading) { |
| 640 | if (found || updateHeadings.indexOf(heading.textContent.trim()) === -1) { |
| 641 | return found; |
| 642 | } |
| 643 | |
| 644 | return heading.nextElementSibling && heading.nextElementSibling.tagName === 'UL' ? heading.nextElementSibling : null; |
| 645 | }, null); |
| 646 | |
| 647 | if (!updateList) { |
| 648 | return []; |
| 649 | } |
| 650 | |
| 651 | return Array.from(updateList.children).map(toHomeUpdateItem).filter(Boolean); |
| 652 | } |
| 653 | |
| 654 | function toHomeUpdateItem(listItem) { |
| 655 | if (!listItem || listItem.tagName !== 'LI') { |