Modify

Opened 3 years ago

Last modified 3 years ago

#9302 new defect

interaction with TracSectionEdit causes Initialize errors

Reported by: jeffrey.guy.lyon@… Owned by: martin_s
Priority: normal Component: NumberedHeadlinesPlugin
Severity: normal Keywords: SectionEditPlugin, Initialize Error
Cc: Trac Release: 0.12

Description (last modified by rjollos)

SectionEditPlugin works fine for all these cases...

= A title =
Some text
# A Heading #
Some Text
## A Subheading ##
Some Text 

However, adding IDs to the headings causes problems. For example,

= A title =#id1
Some text
# A Heading #=id2
Some Text
## A Subheading ##=id3
Some Text 

When clicking on the "Edit" for id1, the whole page opens up for editing instead of just the first seciton. When clicking on "Edit" for either of the numbered headings, the Trac error is issued:

Initialize Error The section <N> that you chose could not be found.

where <N> is 2 or 3 depending on which heading is clicked.

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by rjollos

I think the solution here might be for NumberedHeadlinesPlugin to use # for the anchor rather than =. I tend to think this could be done without interfering with the normal function of the NumberedHeadlinesPlugin.

That is, use:

## Numbered Headline ###ownID

rather than,

## Numbered Headline ##=ownID

You could test this out by a simple modification of the regular expression on line 57 of plugin.py:

r"(?P<nhanchor>=%s)?(?:\s|$))" % XML_NAME

->

r"(?P<nhanchor>#%s)?(?:\s|$))" % XML_NAME

comment:2 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:3 follow-up: Changed 3 years ago by rjollos

See also #5460. I think that fix wasn't correct. I'm planning to investigate further.

comment:4 Changed 3 years ago by rjollos

  • Keywords SectionEditPlugin added; TracSectionEdit removed

comment:5 in reply to: ↑ 3 Changed 3 years ago by rjollos

Replying to rjollos:

See also #5460. I think that fix wasn't correct. I'm planning to investigate further.

This fix was correct for Trac 0.11, but not for 0.12.

comment:6 Changed 3 years ago by rjollos

We need to check whether this issue still occurs following #7826, but if so I'd work on implementing a fix.

comment:7 Changed 3 years ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.