(self, article)
| 1744 | return article |
| 1745 | |
| 1746 | def _parse_article_section_structure(self, article): |
| 1747 | # Sections with higher level are children of previous sections with lower level. |
| 1748 | for i, s2 in enumerate(article.sections): |
| 1749 | for s1 in reversed(article.sections[:i]): |
| 1750 | if s1.level < s2.level: |
| 1751 | s2.parent = s1 |
| 1752 | s1.children.append(s2) |
| 1753 | break |
| 1754 | return article |
| 1755 | |
| 1756 | class MediaWikiArticle(object): |
| 1757 |