Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Replacing div with br

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29239
    PennySave
    Member

    Basically, I am using nicEdit (which has terrible support), and it uses divs instead of BRs, which are showing up in SyntaxHighlighter, which normally is fine. My issue is that many people on my site post CSS, and when they post, they keep getting a bunch of divs showing up in their code…

    So how would i convert </div><div> into <br/>, but only within

    Code:

    ?

    #77035
    PennySave
    Member

    Basicallly, here is the troublesome code it is giving me:

    Code:
    <?php 
    $hello = 'Hello World';
    echo $hello;
    ?>
    #77036
    Rob MacKay
    Participant

    haha thats a silly thing – they should have used <p> – ANYWAY – I am not sure how you can change them, but if you press shift – enter you get a br instead of a div. The issue with this is that the br isn’t closed, so if you are using XHTML it will fail to validate.

    Code:
    boo

    hello

    the code it outputs is especially messy. Personally I would drop it and go with the more popular TinyMCE http://tinymce.moxiecode.com/

    #77109
    PennySave
    Member
    "Robskiwarrior" wrote:
    haha thats a silly thing – they should have used <p> – ANYWAY – I am not sure how you can change them, but if you press shift – enter you get a br instead of a div. The issue with this is that the br isn’t closed, so if you are using XHTML it will fail to validate.

    Code:
    boo

    hello

    the code it outputs is especially messy. Personally I would drop it and go with the more popular TinyMCE http://tinymce.moxiecode.com/

    I’ll probabbly switch if I can figure out what that pushes out, but the issue is I still have to convert all HTML formatting into /n since the stuff within [html][css][php][sql][js] etc. will need to be sanitized if they are put in <pre> tags

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.