comparison src/formats/bbcode.js @ 24:80a86fb8f2b7

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 09 Aug 2022 22:49:59 -0600
parents 1334920263a2
children 80bf0adc9efd
comparison
equal deleted inserted replaced
23:c2a85b2ec677 24:80a86fb8f2b7
633 blockquote: null 633 blockquote: null
634 }, 634 },
635 isInline: false, 635 isInline: false,
636 quoteType: QuoteType.never, 636 quoteType: QuoteType.never,
637 format: function (element, content) { 637 format: function (element, content) {
638 console.log('a');
638 var authorAttr = 'data-author'; 639 var authorAttr = 'data-author';
639 var author = ''; 640 var author = '';
640 var cite; 641 var cite;
641 var children = element.children; 642 var children = element.children;
642 643
654 655
655 if (cite) { 656 if (cite) {
656 element.removeChild(cite); 657 element.removeChild(cite);
657 } 658 }
658 659
660 console.log('qqq');
659 content = this.elementToBbcode(element); 661 content = this.elementToBbcode(element);
660 author = '=' + author.replace(/(^\s+|\s+$)/g, ''); 662 author = '=' + author.replace(/(^\s+|\s+$)/g, '');
661 663
662 if (cite) { 664 if (cite) {
663 element.insertBefore(cite, element.firstChild); 665 element.insertBefore(cite, element.firstChild);
2494 2496
2495 /** 2497 /**
2496 * Initializer 2498 * Initializer
2497 * @private 2499 * @private
2498 */ 2500 */
2499 base.init = function () { 2501 base.init = function (editor) {
2500 base.opts = this.opts; 2502 base.opts = editor.opts;
2501 base.elementToBbcode = elementToBbcode; 2503 base.elementToBbcode = elementToBbcode;
2502 2504
2503 // build the BBCode cache 2505 // build the BBCode cache
2504 buildBbcodeCache(); 2506 buildBbcodeCache();
2505 2507
2506 this.commands = extend( 2508 editor.commands = extend(
2507 true, {}, defaultCommandsOverrides, this.commands 2509 true, {}, defaultCommandsOverrides, editor.commands
2508 ); 2510 );
2509 2511
2510 // Add BBCode helper methods 2512 // Add BBCode helper methods
2511 this.toBBCode = base.toSource; 2513 editor.toBBCode = base.toSource;
2512 this.fromBBCode = base.toHtml; 2514 editor.fromBBCode = base.toHtml;
2513 }; 2515 };
2514 2516
2515 /** 2517 /**
2516 * Converts BBCode into HTML 2518 * Converts BBCode into HTML
2517 * 2519 *