jordandelozier / wysibb

WYSIWYG BBcode editor
http://www.wysibb.com
246 stars 86 forks source link

Adding/Changing tags doesn't work #170

Closed CaptainHypertext closed 7 years ago

CaptainHypertext commented 7 years ago

Really hoping I can get an answer here, because I really like this plugin and am trying to use it for my site.

I tried changing bb code tags as detailed in this documentation, however, it's not working. When I select text and click my button, it just deletes the text. When in BB Code view, if I type the code in, or paste it, it remains unparsed.

Here is my setup code:

$('#bio-editor').wysibb({
    buttons: 'bold,italic,underline,strike,|,img,link,|,bullist,numlist,|,fontcolor,fontsize,|,left,center,right,|,quote,code,removeFormat',
    allButtons: {
        strike: {
            transform: {
                '<span style="text-decoration: line-through;">{SELTEXT}</span>': '[strikeout]{SELTEXT}[/strikeout]'
            }
        },
        left: {
            title: 'Left Align',
            buttonText: 'Left',
            transform: {
                '<div style="float: left; margin-right: 20px">{SELTEXT}</div>': '[left]{SELTEXT}[/left]'
            }
        },
        right: {
            title: 'Right Align',
            buttonText: 'Right',
            transform: {
                '<div style="float: right; margin-left: 20px">{SELTEXT}</div>': '[right]{SELTEXT}[/right]'
            }
        },
        center: {
            title: 'Center Align',
            buttonText: 'Center',
            transform: {
                '<div style="text-align: center;">{SELTEXT}</div>': '[center]{SELTEXT}[/center]'
            }
        }
    }
});

What I'm trying to do here is replace the default [justifyleft], [justifycenter], [justifyright] with [left], [center], [right], which are what my forums have been using for years, but I can't tell what I'm doing wrong.

Any help is appreciated.

CaptainHypertext commented 7 years ago

Never mind, you can close this. Turns out the phpBB template system was pulling out {SELTEXT} and replacing it with a blank.

jordandelozier commented 7 years ago

Great, let us know if you find any more issues/bugs.