Indefero

Issue 618: Invalid markup with table of content JS

Reported by Thomas Keller, Feb 28, 2011

Several pages of our own documentation look completely destroyed 
with this:

http://projects.ceondo.com/p/indefero/page/AutomaticLinks/

http://projects.ceondo.com/p/indefero/page/InstallationScmMonotone/

Comment 1 by Loïc d'Anterroches, Feb 28, 2011

Maybe the current version is too old. Pushing a new version online 
now.

Comment 2 by Loïc d'Anterroches, Feb 28, 2011

There is a real problem with the AutomaticLinks page, the parser is 
chocking on the content. If you view-source the page, you will see 
nothing.

For the monotone installation, we have a title length problem.

Comment 3 by Thomas Keller, Mar 1, 2011

The title length issue and some CSS nuisances have been fixed in 
revision 41cfbbd.
Status: Accepted
Owner: tommyd

Comment 4 by Thomas Keller, Mar 1, 2011

The parser problem now is very interesting. It seems to boil down to 
a preg_replace_callback() problem in PHP (documented here: 
http://bugs.php.net/40846)


This is a minimal test case I could make:

  src :minimal.length#1, or src:b@1#1

(remove the space after "src" to see it actually fail - I 
could not do it in here, otherwise the complete post would have been 
lost)

and this is the regex which is ran and failed against it:

  =(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,
   \(\)\\\\]+){0,})+(?:\@([^\s#,]+))(?:#(\d+))?=im

(preg_replace_callback() returns NULL with this regex and input and 
preg_last_error() is PREG_BACKTRACK_LIMIT_ERROR) 

Interestingly, the problem goes away if I raise the PHP variable 
'pcre.backtrack_limit' enough, to say 10.000.000 like proposed in 
the linked PHP bug. The question is now if we want to apply this fix 
somewhere (preferrable in idf.php globally) or if we want to wind 
our heads around the regex and try to improve the magic there even 
more.

I'm for the former option.

Comment 5 by Thomas Keller, Mar 3, 2011

A local fix has been applied to Markdown.php and IssueComment.php in 
revision f63bfcb.
Status: Fixed

Comment 6 by Thomas Keller, Mar 16, 2011

Issue still persists on projects.ceondo.com.
Status: Started

Comment 7 by Thomas Keller, Mar 18, 2011

Fixed in commit 734ddda.

@Loic: Please update projects.ceondo.com if you have some spare time.
Status: Fixed

Created: 2 years 2 months ago by Thomas Keller

Updated: 2 years 2 months ago

Status: Fixed

Owner: Thomas Keller

Followed by: 1 person

Labels:
Type:Defect
Milestone:Release1.1
Priority:Critical