Loading ...
Sorry, an error occurred while loading the content.

clip to html code text list?

Expand Messages
  • Jonathan Woodbridge
    I m wondering if anyone has coded a clip to take a text list of this kind of format: [space space]First item [space space]Second item [space space]Third item
    Message 1 of 3 , Dec 5, 2002
    • 0 Attachment
      I'm wondering if anyone has coded a clip to take a text list of this
      kind of format:

      [space space]First item
      [space space]Second item
      [space space]Third item

      or similar list like this:

      * First item
      * Second item
      * Third item

      and transform them into the html coded versions:

      <ul>
      <li>First item</li>
      <li>Second item</li>
      <li>Third item</li>
      </ul>

      It seems like a very common problem. I would do it but I'm lazy and I'm
      sure someone else has already done it...

      bites?

      thanks,

      Jonathan
    • John Zeman
      I had to chuckle at your I m lazy comment Jonathon.. :) Below is a clip I recently threw together for a project I was working on that does most of what you
      Message 2 of 3 , Dec 5, 2002
      • 0 Attachment
        I had to chuckle at your "I'm lazy" comment Jonathon.. :)

        Below is a clip I recently threw together for a project I was working on that does most of what you want..

        It doesn't strip the extra spaces or add the beginning and ending <UL> </UL> tags but otherwise it should format your text the way you want providing you only have single line breaks between your list items.

        I'm afraid I'm too lazy to alter this to be exactly what you want.. <Grin>

        Have a good one

        John

        ^!Continue This clip places HTML <li></li> tags around each line of text in a document.^%NL%^%NL%If not already done, cancel this clip and create a temp file that has the text you want to format.^%NL%^%NL%Then run this clip again to process the text.^%NL%^%NL%Otherwise press OK to continue now.
        ^!Jump DOC_START
        ^!InsertHtml <li>
        ^!Replace "^P" >> "</li>^P<li>" ATIWS
        ^!Jump DOC_END
        ^!InsertHtml </li>







        --- In ntb-html@y..., "Jonathan Woodbridge" <woodbridge@a...> wrote:
        > I'm wondering if anyone has coded a clip to take a text list of this
        > kind of format:
        >
        > [space space]First item
        > [space space]Second item
        > [space space]Third item
        >
        > or similar list like this:
        >
        > * First item
        > * Second item
        > * Third item
        >
        > and transform them into the html coded versions:
        >
        > <ul>
        > <li>First item</li>
        > <li>Second item</li>
        > <li>Third item</li>
        > </ul>
        >
        > It seems like a very common problem. I would do it but I'm lazy and I'm
        > sure someone else has already done it...
        >
        > bites?
        >
        > thanks,
        >
        > Jonathan
      • Jonathan Woodbridge
        John, Hugo: A triumph for laziness! Thanks for the code, it s going in my toolbox. ... that s right! If you had custom coded a long clip I would have felt
        Message 3 of 3 , Dec 6, 2002
        • 0 Attachment
          John, Hugo:

          A triumph for laziness! Thanks for the code, it's going in my toolbox.

          > I'm afraid I'm too lazy to alter this to be exactly what you want..

          that's right! If you had custom coded a long clip I would have felt
          guilty. Make them laugh then snatch their code and run, that's what I
          say!!!

          best,

          Jonathan
        Your message has been successfully submitted and would be delivered to recipients shortly.