• Added capability for pic captions (oh, this also fixed space bug in pic names)

    By Randal Oulton 1 decade ago

    format of code in text:

    [image:mypicture.jpg|left|my caption ]



    I trim out spaces, so doesn't matter if spaces around the pipe symbol or not, as users can never remember.



    If a caption is being supplied, then a left or right alignment must be supplied.



    Here is the code, which replaced that in : convertSingleBracket function.


        Case &quot;image&quot;<br/>
            ' Image<br/>
            Dim rawrightText As String<br/>
            Dim caption As string<br/>
            leftText = StrRightBack(newText, &quot;:&quot;)<br/>
            linkText = StrLeft(leftText, &quot;|&quot;)<br/>
            If (Len(linkText) = 0) Then<br/>
                linkText = leftText<br/>
            End If<br/>
            rawrightText = Trim(StrRight(leftText, &quot;|&quot;))<br/>
            If ( InStr(rawrightText, &quot;|&quot;) &lt;&gt; 0) Then<br/>
                rightText=StrLeftBack(rawrightText, &quot;|&quot;)<br/>
                caption = Trim(StrRightBack(rawrightText, &quot;|&quot;))<br/>
            Else<br/>
                rightText = rawrightText<br/>
            End If<br/>
            newText = |&lt;img class=&quot;wiki-img&quot; src=&quot;/| &amp; dbPath &amp; &quot;/Pages/&quot; &amp;_<br/>
            Me.Subject &amp; &quot;/$file/&quot; &amp; linkText &amp; |&quot;|<br/>
    


            If (Len(rightText) = 0) Then<br/>
                newText = newText &amp; |&gt;|<br/>
            Elseif (Lcase(rightText) = &quot;right&quot;) Or (Lcase(rightText) = &quot;left&quot;) Then<br/>
                newText = |&lt;div style=&quot;padding-top:10px;float:| &amp; rightText &amp; |&quot;&gt;| &amp; newText &amp; |&gt;&lt;p&gt;| &amp; caption &amp; |&lt;/div&gt;&lt;div style=&quot;padding-bottom:10px;clear:both&quot;&gt;&lt;/div&gt;|<br/>
            Else<br/>
                newText = newText &amp; | alt=&quot;| &amp; rightText &amp; |&quot;&gt;|<br/>
            End If