(listItem)
| 831 | } |
| 832 | |
| 833 | function toArticleItem(listItem) { |
| 834 | var link = listItem.querySelector('a[href]'); |
| 835 | |
| 836 | if (!link) { |
| 837 | return null; |
| 838 | } |
| 839 | |
| 840 | var href = link.getAttribute('href') || ''; |
| 841 | var markdownPath = toMarkdownPath(href); |
| 842 | |
| 843 | if (!markdownPath || !isArticleMarkdown(markdownPath)) { |
| 844 | return null; |
| 845 | } |
| 846 | |
| 847 | var rawText = listItem.textContent.replace(/\s+/g, ' ').trim(); |
| 848 | var dateMatch = rawText.match(/^(\d{4}-\d{2}-\d{2})\s*-\s*/); |
| 849 | |
| 850 | return { |
| 851 | date: dateMatch ? dateMatch[1] : '', |
| 852 | href: toRouteHref(markdownPath), |
| 853 | item: listItem, |
| 854 | markdownPath: markdownPath, |
| 855 | title: link.textContent.trim() |
| 856 | }; |
| 857 | } |
| 858 | |
| 859 | function renderCard(article) { |
| 860 | var item = article.item; |
nothing calls this directly
no test coverage detected