UEdit capable of displaying formatted BBCode?

UEdit capable of displaying formatted BBCode?

7
NewbieNewbie
7

    Nov 05, 2007#1

    I just downloaded the BBCode tag list, and it works great. Thanks to the developer!

    But I'd like to know if there's any way I can preview the file I'm working on with all or most of the BBCode formatting displayed.

    6,675585
    Grand MasterGrand Master
    6,675585

      Nov 05, 2007#2

      BBCode is on forum pages translated to HTML code with PHP scripts. Therefore you need a local PHP script interpreter installed and the script which reads the file you pass to the script and outputs the HTML file to the browser.

      So the answer is NO, UltraEdit cannot display a file with BBCode as formatted HTML file.
      Best regards from an UC/UE/UES for Windows user from Austria

      262
      MasterMaster
      262

        Nov 05, 2007#3

        As Mofi writes, BBcodes are transformed into HTML by the forum/board software (often written in PHP). Each forum also have one or more style sheets that determines how the html should be presented (font, spacing, graphics etc).

        So it isn't really possible to ask UE to supply a preview option for BBcode.

        In some forum software you are even able to define your own BBcodes (like in phpBB) and they are stored in the phpBB application and a text editor like UE can't have any knowledge of this.

        But if you for some reason (like working offline, without local PHP script interpreter) you need to see how your BBcode-tagged document looks like in a browser, then if you are a version 13 user then check out the script attached:

        It basically copies your BBcode-tagged document into a new temporary document. Runs through a number of predefined BBcode to HTML conversions (using Regular expressions). After the script has run, then just toggle View - Toggle Browser View.

        You have to modify the script to your specific purpose. See the function defineSupportedTranslations(); In this you will find pairs of

        // Check for bold text
        BBcodes.push("\\[b\\]([^ÿ]+?)\\[/b]");
        HTML.push('<strong>\\1</strong>');


        You should add similar pairs for your BBcode use if some are missing.

        Also some BBcodes - code, PHP, quote - have larger HTML replacements. These should be modified also. They reference styles in an external stylesheet.

        This external stylesheet has to be referenced in the function named writeHTMLtop(). Look for http://www.yourserver.com.

        The script is "as is". There's plenty of room for improvements. Use at own risk.
        parsebbcode.zip (1.8 KiB)   383

        7
        NewbieNewbie
        7

          Nov 06, 2007#4

          jorrasdk, I am greatly indebted to you for such an outstandingly informative and helpful post. Although I understand and appreciate why a built-in or similar BBcode parser and previewer is an unreasonable request, I am honor bound to tell you that the script you so kindly provided works adequately for my purposes as is.

          Thank you!

          As an aside, would you prefer that I send any observations of problematic features to you or someone else? Please don't interpret that question to at all encourage or request you to spend time you may well not have or not wish to spend on such a task.



          I, too, am currently using: UE13.20 (English edition). Windows XP SP2

          262
          MasterMaster
          262

            Nov 06, 2007#5

            I'm glad it was useful.
            amby wrote:As an aside, would you prefer that I send any observations of problematic features to you or someone else?
            Observations of that nature are welcome since it will only improve the value of what's on this board - not necessarily improved value for me - but for the next visitor seeking a similar solution. Just post your observations and I or other users will respond.