rehamaltamimi / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

__TOC__ element following a single <h1> but before multiple <h2> elements results in the table of contents ONLY displaying the <h1> element in the TOC.d #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create a wiki page the looks like:
= My Title =
__TOC__
== sec 1 ==
stuff
== sec 2 ==
stuff
== sec3 ==
stuff
== sec4 ==
stuff
2. Not that the generated TOC only shows "My Title"
3. If you move the __TOC__ element below "== sec 1 ==", the table of
contents renders properly with all == sec# == elements in the TOC.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
bliki 3.0.11

Please provide any additional information below.

Original issue reported on code.google.com by steven.b...@gmail.com on 30 Apr 2009 at 4:17

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 30 Apr 2009 at 4:26

GoogleCodeExporter commented 8 years ago
I ran into this one tonight, and was able to track down the cause.  It is 
caused by cloning the toc tag, but continuing to use the the toc anchor list 
from the cloned object.  The one-liner fix is below.

Thanks for the awesome library!

### Eclipse Workspace Patch 1.0
#P info.bliki.wiki
Index: bliki-core/src/main/java/info/bliki/wiki/model/AbstractWikiModel.java
===================================================================
--- 
bliki-core/src/main/java/info/bliki/wiki/model/AbstractWikiModel.java   (revision 
3603)
+++ 
bliki-core/src/main/java/info/bliki/wiki/model/AbstractWikiModel.java   (working 
copy)
@@ -883,6 +883,7 @@
                tableOfContentTag.setShowToC(true);
                tableOfContentTag.setTOCIdentifier(isTOCIdentifier);
                fTableOfContentTag = tableOfContentTag;
+               fTableOfContent = null;
                // } catch (CloneNotSupportedException e) {
                // e.printStackTrace();
                // }

Original comment by HebnerN@gmail.com on 9 Jun 2011 at 7:54

GoogleCodeExporter commented 8 years ago
Patch commited with r3604

Original comment by axelclk@gmail.com on 9 Jun 2011 at 5:39