Hi,
I'd like to add a couple of custom tags (I'm using this in a forum, so need [quote] and [code])
I have the code needed, but am struggling to find an example on how I can add this custom "wrap" around some content.
Something like:
<hr>
--- QUOTE-----
their content goes here
</hr>
TIA
Andy
I'd like to add a couple of custom tags (I'm using this in a forum, so need [quote] and [code])
I have the code needed, but am struggling to find an example on how I can add this custom "wrap" around some content.
Something like:
<hr>
--- QUOTE-----
their content goes here
</hr>
TIA
Andy

Re: New custom tags
Surely adding custom HTML "wrapping" isn't that hard? I just can't find any demos on how to do it :/
Cheers
Andy
Re: New custom tags
exec : function( editor ) { editor.insertText('<hr>' + editor.getSelection().getNative() + '</hr>') }Re: New custom tags
Re: New custom tags
to
editor.insertText('<hr>' + editor.getSelection().getNative() + '</hr>')Re: New custom tags
editor.getSelection().getNative() returns [object] rather than the actual text.
Re: New custom tags
/** * Wrap the editor's selection with the specified the template, in which * the selected content is denoted by ${selection}. * @example * editor.wrapSelectionWith( '<hr /> ${selection} <hr />' ); */ CKEDITOR.editor.prototype.wrapSelectionWith = function( template ) { var temp = new CKEDITOR.dom.element( 'div' ); temp.append( this.getSelection().getRanges()[ 0 ].cloneContents() ); this.insertHtml( template.replace( /\$\{selection\}/, temp.getHtml() ) ); }Re: New custom tags