• Nested unsorted lists

    By Jorge Tomé Hernando 1 decade ago

    Now it is possible to create a

      list using " ", but it is totally impossible to create a nested list.

      I would like to be able to use, for example, "
      " to nested a second level and "** " to nested a third level, and so on.



      Best regards

    • Jorge: My quick hack...

      By John Smart 1 decade ago

      Jorge,



      It's not part of the main code stream, but my quick hack was to allow ul, ol, and li tags by adding the following lines to WikiPage.allowSafeHTML (in the WikiPage.class script library):

      safelist(12) = "ul"

      safelist(13) = "ol"

      safelist(14) = "li"

    • A simple solution

      By Dave Parillo 1 decade ago

      A simple solution (that doesn't include ordered lists):

      Not as simple to implement as John's, but no html in the wiki markup, which I think is better.





      Call the function doList iteratively from the existing


      Private Function parseLists (txt As String) As String<br/>
          '** lines beginning with a * should be bullet lists<br/>
                  '** 10 levels of indent should be enough for anyone<br/>
          Dim i As Integer<br/>
          parseLists = doList (txt, 10)<br/>
          For i = 9 To 1 Step -1<br/>
              parseLists = doList (parseLists, i) <br/>
          Next<br/>
      End Function<br/>
      <br/>
      


         ' Create list items for each * found at the beginning of a line<br/>
         ' param txt           - the whole wiki page text<br/>
         ' param amount  - the number of bullets to search for<br/>
      Private Function doList (txt As String, amount As Integer) As String<br/>
          doList = ReplaceRangeEnds(txt, Chr(10) &amp; Ustring(amount, &quot;*&quot;), Chr(10), _<br/>
          &quot;&lt;li class='level&quot; &amp; amount &amp; &quot;'&gt;&quot; , &quot; &lt;/li&gt;&quot; &amp; Chr(10),  Chr(10) , False)    <br/>
          <br/>
          doList = ReplaceRangeEnds(doList, Chr(10) &amp; Ustring(amount, &quot;*&quot;), Chr(10), _<br/>
          &quot;&lt;li class='level&quot; &amp; amount &amp; &quot;'&gt;&quot; , &quot; &lt;/li&gt;&quot; &amp; Chr(10),  Chr(10) , False)    <br/>
          <br/>
          doList = ReplaceRangeEnds(doList, Chr(10) &amp; Ustring(amount, &quot;*&quot;), Chr(10), _<br/>
          &quot;&lt;li class='level&quot; &amp; amount &amp; &quot;'&gt;&quot; , &quot; &lt;/li&gt;&quot; &amp; Chr(10),  Chr(10) , False)            <br/>
      End Function