1.1 --- a/actions/SectionBreakout.py Mon Feb 21 01:55:43 2011 +0100
1.2 +++ b/actions/SectionBreakout.py Sat Feb 26 21:45:56 2011 +0100
1.3 @@ -146,7 +146,18 @@
1.4
1.5 else:
1.6 if current_region_start is not None:
1.7 - regions.append(current_region_start + (len(page_body),))
1.8 + heading, region_start = current_region_start
1.9 +
1.10 + # Prevent any capture of end-of-page category information.
1.11 +
1.12 + l = getCategoryDeclarations(page_body)
1.13 + if not l:
1.14 + region_end = len(page_body)
1.15 + else:
1.16 + declaration, (start, end) = l[-1]
1.17 + region_end = max(region_start, start)
1.18 +
1.19 + regions.append((heading, region_start, region_end))
1.20
1.21 # Make new pages for each region, rebuilding the current page body.
1.22
1.23 @@ -180,7 +191,7 @@
1.24 # Add categories if the parent page has any.
1.25
1.26 if new_page_categories != categories:
1.27 - new_page_body += getCategoryDeclaration(categories)
1.28 + new_page_body += makeCategoryDeclaration(categories)
1.29
1.30 # Save the new page.
1.31
1.32 @@ -218,7 +229,7 @@
1.33 # broken out.
1.34
1.35 if edited_page_categories != categories:
1.36 - edited_page_body += getCategoryDeclaration(categories)
1.37 + edited_page_body += makeCategoryDeclaration(categories)
1.38
1.39 # Save the current page.
1.40