User Tag List

Results 1 to 3 of 3

Thread: HTML Syntax Highlighting

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML Syntax Highlighting

    Hey guys, just made this engine to display HTML in a nicer fashion, but the only problem it totally lags with big chunks of html (esp if you have the highest setting of coloring in selected)

    Does anyone know a more efficient way of conquering this? I know in MMF1.5 we had the lovely StringManipulator but nothing like that exists in MMF2

    Thanks, Si

    (for speed only have Tag 0 checked, for full amount of coloring select all the buttons - found underneath the main edit box)
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTML Syntax Highlighting

    Some expressions you'll like:

    find() and reversefind()

    They're built into MMF2, and let you quickly find the locations of characters in a string. EG:

    find(Edittext$("HTML CODE"), "<", 16)

    Using this above will go to character #16 in the HTML code and seek for the first "<" just right of char 16.

    Reversefind() is identical, but looks to the left.

    So, you can scan through the HTML, finding different characters in different situations, using either find() to seek forward, or reversefind() to retrace backwards.

    You can also use it to skip unimportant text. So if you have this code:

    <b>Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah</b>

    You can do find(Edittext$("HTML"), "<", pointer("VARS"))

    Just keep increasing the 'pointer' value. It'll allow you to skip all that body text and go straight to the next tag.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTML Syntax Highlighting

    Thanks for the help, but im finding it really hard to efficiently implement this feature. Does anyone know of any good examples?

    Thanks again, Si

Similar Threads

  1. Syntax highlighting
    By Looki in forum Extension Development
    Replies: 5
    Last Post: 22nd October 2015, 04:06 PM
  2. highlighting an object
    By Jason in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th September 2006, 04:04 AM
  3. RTF Highlighting.
    By Conno in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th August 2006, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •