Modify

Opened 4 years ago

Closed 4 years ago

#6712 closed defect (duplicate)

Section edit for numbered headlines

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

Description (last modified by rjollos)

Section edit does not work with numbered sections (NumberedHeadlinesPlugin) 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):

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by rjollos

  • Description modified (diff)
  • Resolution set to duplicate
  • Status changed from new to closed

Fixed in #5460.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.