• Indentation of Lists

    By Peter D Presnell 2 decades ago

    On of the issues I have found in using DominoWiki is that the way lists are created by replacing "" with <li>. It seems that because the list are not placed inside <ul>… </ul> tags that all subsequent text that follows the list becomes indented.



    This is only a partial fix, but I found that by replacing the ParseLists function with the following code:-



    Public Function parseLists (Byval txt As String) As String

    '
    lines beginning with "" are bullet items

    Dim ListStartPos As Long

    Dim ListEndPos As Long

    <br/>
    

    While Instr(txt, Chr(10) & "") > 0

    ListStartPos& = Instr(txt, Chr(10) & "
    ")

    txt = Replace(txt, Chr(10) & "*", Chr(10) "<ul><li>",ListStartPos&,1)

    txt = Replace(txt, Chr(10) , "</ul>" + Chr(10),ListStartPos&+1,1)

    Wend

    parseLists = txt

    End Function



    I could at least get each list item inside a UL tag.



    I then needed to modify the style sheet to stop the excessive spacing between each list element…



    ul

    {

       margin-top: 0;<br/>
       margin-bottom: 0;<br/>
    

    }



    Ideally each list should be placed inside a single<ul> </ul> tag rather than each and every list item, but I haven't figured that part out (yet!)

    • Another idea

      By Dave Parillo 2 decades ago

      I ended up not bothering with lists at all, but changing the '' markup to be the same as the ':' markup - i.e. an indented div which stands on it's own. To make it unique, give the div its own class attribute. You don't have to know it's part of a larger list.



      Private Function doList(txt As String, amount As Integer) As String

      doList= ReplaceRangeEnds(txt, Chr(10) & Ustring(amount, "
      "), Chr(10),

      Chr(10) & "

      " , "
      " & Chr(10), "" , True)



      doList= ReplaceRangeEnds(doList, Chr(10) & Ustring(amount, "
      "), Chr(10),


      "
      " , "
      ", Chr(10) , False)

      End Function





      Change parseLists to call this function for varying numbers of *'s



      Then you can style the div to make it look like a list (i.e. give it a background-url)