Opened 14 years ago

Last modified 13 years ago

#6712 closed defect

Section edit for numbered headlines — at Initial Version

Reported by: andras.lipoth@… Owned by: Catalin BALAN
Priority: normal Component: SectionEditPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Section edit does not work with numbered sections (TracNumberedHeadlinesPlugin) due to different headline format (### instead of ===). The fix is trivial, see below:

diff --git a/0.11/tracsectionedit/web_ui.py b/0.11/tracsectionedit/web_ui.py
index c93b410..1cd7131 100644
--- a/0.11/tracsectionedit/web_ui.py
+++ b/0.11/tracsectionedit/web_ui.py
@@ -98,6 +98,8 @@ class WikiSectionEditModule(Component):
                 is_code_block = False
             if is_code_block == False and re.match(r'^\s*(={1,5}) .+ \1(?:\s*#.
                 count = count + 1
+            if is_code_block == False and re.match(r'^\s*(#{1,5}) .+ \1(?:\s*#.
+                count = count + 1
             if count < int(section):
                 pre.append(line)
             elif count == int(section):

Change History (0)

Note: See TracTickets for help on using tickets.