#5460 closed enhancement (fixed)
[Patch] Support for NumberedHeadlinesPlugin
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | low | Component: | SectionEditPlugin |
Severity: | minor | Keywords: | |
Cc: | Martin Scharrer | Trac Release: | 0.11 |
Description (last modified by )
When trying to edit a section delimited by the NumberedHeadlinesPlugin, an error such as the following is seen:
The section 1 that you chose could not find.
Not sure if it´s a consistent solution, however I hacked the re in line 99 of web_ui.py and seems to work fine here for both =* and #* headline syntax:
-
0.11/tracsectionedit/web_ui.py
96 96 is_code_block = True 97 97 elif is_code_block == True and re.match(r'^\s*}}}\s*$', line): 98 98 is_code_block = False 99 if is_code_block == False and re.match(r'^\s*( ={1,5}) .+ \1(?:\s*#.+)?\s*$', line):99 if is_code_block == False and re.match(r'^\s*([=#]{1,5}) .+ \1(?:\s*#.+)?\s*$', line): 100 100 count = count + 1 101 101 if count < int(section): 102 102 pre.append(line) … … 106 106 break 107 107 post = page_list[i:] 108 108 if len(target) == 0: 109 raise TracError(_('The section %(num)d that you chose could not find.', num=int(section)), _('Initialize Error'))109 raise TracError(_('The section %(num)d that you chose could not be found.', num=int(section)), _('Initialize Error')) 110 110 111 111 return pre, target, post
Thanks,
Attachments (0)
Change History (7)
comment:3 Changed 15 years ago by
Summary: | Support for NumberedHeadlinesPlugin → [Patch] Support for NumberedHeadlinesPlugin |
---|
comment:4 follow-up: 5 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Type: | defect → enhancement |
comment:5 Changed 14 years ago by
Owner: | changed from Catalin BALAN to Ryan J Ollos |
---|---|
Status: | new → assigned |
Replying to rjollos:
I fixed up the patch in the description and tested it out. I'd like to see it applied to the repository if possible, it's a net 3 char change to the regex. I'm happy to go ahead and do this if its okay with the plugin maintainer (have global write access to the repository).
Since no response from the author after two weeks and its such a simple patch, I'm going to go ahead and apply it. We can always roll it back if the author has an objection.
comment:4 follow-up: 5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [9816]) Added support for the NumberedHeadlinesPlugin. Thanks to tiago for the patch. Fixes #5460.
comment:5 Changed 14 years ago by
Cc: | Martin Scharrer added; anonymous removed |
---|
I fixed up the patch in the description and tested it out. I'd like to see it applied to the repository if possible, it's a net 3 char change to the regex. I'm happy to go ahead and do this if its okay with the plugin maintainer (have global write access to the repository).