Opened 6 years ago

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

Reported by: Owned by: alex normal SectionEditPlugin normal 0.12

Consider the following markup:

= The Sandbox =

== Section 1 ==

{{{#!td
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:

[[Image(example.png)]]

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).


### Changed 6 years ago by alex

Example rendered.

### comment:2 Changed 5 years ago by Ryan J Ollos

Description: modified (diff)

### comment:3 Changed 5 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 =

Lorem ipsum...

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

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 6 months ago by Ryan J Ollos

Owner: Catalin BALAN deleted

### Modify Ticket

Change Properties