Opened 6 years ago

Last modified 15 months ago

#9891 new defect

Fails on pages where title markup is present but are not titles

Reported by: alex Owned by:
Priority: normal Component: SectionEditPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Consider the following markup:

= The Sandbox =

== Section 1 ==

Table cell for title examples:
=== Title example ===
  (line above prevents from messing up the markup; please ignore)

== Section 2 ==

Content for section 2.

It is rendered as this:


Titles (sections) are numbered as follows:
 * The Sandbox: `section=1`
 * Section 1: `section=2`
 * Section 2: `section=3`

However, the plugin is confused by the markup `=== Title example ===` included in the middle of the `#!td` element, and edition is done on ''Title example'' when ''Section 2'' is edited.

This behavior is easily reproducible by trying to edit a section on the WikiFormatting page of Trac version >=0.12 (where such title markup syntax examples are included).

Attachments (1)

example.png (5.2 KB) - added by alex 6 years ago.
Example rendered.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by alex

Attachment: example.png added

Example rendered.

comment:2 Changed 6 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 6 years ago by memartin

I was about to file a similar bug when I stumbled about this one. I am using SectionEditPlugin together with NumberedHeadlinesPlugin, which leads to a similar behavior. I use a lot of code samples on wiki pages, and SectionEdit becomes confused with some (not all!) comment lines. So this markup

= Title =

== Headline 1 ==

Lorem ipsum...

# some comment
echo "Hello world!"
-alias bar='foo'
+alias foo='bar'
!}}}  <-- (disregard the exclamation mark)

== Headline 2 ==

Lorem ipsum...

is split up into 4 sections, section 2 beginning at the comment line contained in the code sample. This comes to light especially in large system documentations I write to remember what I've done on my servers the day before. Section numbers on the bottom of the page are sometimes off by 5+.

Im am not absolutely sure this phenomenon corresponds with this bug, since it could well be in !NumberedHeadlines' realm. Also not all comment lines are handled as section starters - if you insert a line break between the starting '{{{' and the '#!diff' keyword (still valid wiki markup), SectionEditPlugin correctly detects 3 sections.

For me, maybe it would already help if !SectionEdit would check for trailing headline indicators. But I know that they are optional for valid wiki markup.

comment:4 Changed 15 months ago by Ryan J Ollos

Owner: Catalin BALAN deleted

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.

Add Comment

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

Note: See TracTickets for help on using tickets.