Defect #10642

Nested textile ol/ul lists generate invalid HTML

Added by Hansen Ler over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Projects
Target version:1.4.1
Resolution:Fixed Affected version:1.3.2

Description

My Project Description is as follows:

To track issue:
# Click on the *New Issue* link on top.
# Specify the *Tracker* as _Bug_ or _Feature_
** _Bug_ is a problem to fix.
** _Feature_ is new enhancement to the version
# Enter _Subject_ and _Description_
** For hyperlink reference to existing feature/bug, you can use the *#XX*
e.g. Bug #100 will create a link to the bug.

If I've got more than one Projects in Projects view, the next Project item (e.g. My Project 2) in the list will break.

See attached image.

Bullet-issue.png (134 KB) Hansen Ler, 2012-04-11 12:43

projects.png (4.58 KB) Jean-Philippe Lang, 2012-04-13 19:13

Associated revisions

Revision 9430
Added by Jean-Philippe Lang over 5 years ago

Fixed that textile nested lists are not properly closed in output (#10642).

History

#1 Updated by Etienne Massip over 5 years ago

  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release

Even lost the end of the text.

#2 Updated by Jean-Philippe Lang over 5 years ago

Can't reproduce with current trunk. Tested with default and classic themes, using FF11.0, Chrome 18 or IE9.

#3 Updated by Hansen Ler over 5 years ago

Maybe there's some fix in between? Let me test when there's new release...
that's super fast response from jean! Cheers!

#4 Updated by Etienne Massip over 5 years ago

No, I reproduced with trunk but with only a part of the text you posted.

#5 Updated by Jean-Philippe Lang over 5 years ago

Etienne Massip wrote:

No, I reproduced with trunk but with only a part of the text you posted.

Which part exactly?

#6 Updated by Etienne Massip over 5 years ago

Well, the last part I think but I'll check again.

#7 Updated by Jean-Philippe Lang over 5 years ago

  • Description updated (diff)

Got it.

#8 Updated by Jean-Philippe Lang over 5 years ago

This is a textile issue. This text generates invalid html (closing tags at the end are in reverse order).

Here is a patch that fixes it:

Index: lib/redcloth3.rb
===================================================================
--- lib/redcloth3.rb    (revision 9405)
+++ lib/redcloth3.rb    (working copy)
@@ -585,9 +585,10 @@
                     last_line = line_id
                 end
                 if line_id - last_line > 1 or line_id == lines.length - 1
-                    depth.delete_if do |v|
+                    depth.reverse.each do |v|
                         lines[last_line] << "</li>\n\t</#{ lT( v ) }l>" 
                     end
+                    depth = []
                 end
             end
             lines.join( "\n" )

#9 Updated by Jean-Philippe Lang over 5 years ago

  • Target version changed from Candidate for next minor release to 1.4.1

#10 Updated by Jean-Philippe Lang over 5 years ago

  • Subject changed from If your Project Description uses bullets, viewing Projects page will cause the next project in list to Break to Nested textile ol/ul lists genrate invalid HTML
  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r9430.

#11 Updated by Etienne Massip over 5 years ago

  • Subject changed from Nested textile ol/ul lists genrate invalid HTML to Nested textile ol/ul lists generate invalid HTML

Typo.

#12 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF