hectorguo / CKEditor-Markdown-Plugin

Markdown Plugin for CKEditor
http://hectorguo.github.io/CKEditor-Markdown-Plugin/
112 stars 24 forks source link

Markdown Button is not loaded in inline editor #17

Open Andreas-Schoenefeldt opened 8 years ago

Andreas-Schoenefeldt commented 8 years ago

Hello, if I use the inline editor, the markdown button is not displayed:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>A Simple Page with CKEditor</title>
        <!-- Make sure the path to CKEditor is correct. -->
        <script src="ckeditor.js"></script>
    </head>
    <body>
        <form>
            <div id="editor1" rows="10" cols="80" contenteditable="true">
                This is my textarea to be replaced with CKEditor.
            </div>
            <script>
                // Replace the <textarea id="editor1"> with a CKEditor
                // instance, using default configuration.
                CKEDITOR.inline( 'editor1' );
            </script>
        </form>
    </body>
</html>

and the config.js

/**
 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here.
    // For complete reference see:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    // The toolbar groups arrangement, optimized for two toolbar rows.
    config.toolbarGroups = [

        { name: 'styles' },

        // { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
        // { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
        // { name: 'insert' },
        // { name: 'forms' },
        { name: 'tools' },

        // { name: 'document',     groups: [ 'mode', 'document', 'doctools' ] },
        // '/',
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph',   groups: [ 'list' ] },

        { name: 'links' },

        // { name: 'markdown'}
        { name: 'others' }

        //

        // { name: 'colors' },
        // { name: 'about' }
    ];

    config.removePlugins = 'stylescombo';

    // Remove some buttons provided by the standard plugins, which are
    // not needed in the Standard(s) toolbar.
    config.removeButtons = 'Subscript,Superscript,Anchor,Strike';

    config.extraPlugins = 'markdown'; // adding the markdown plugin

    // Set the most common block elements.
    config.format_tags = 'p;h1;h2;h3';

    // Simplify the dialog windows.
    config.removeDialogTabs = 'image:advanced;link:advanced';
};
ghost commented 8 years ago

In your config.toolbarGroups, markdown button is uncommented. Thus, if uncommenting this line does not work then try with Markdownwith a capital 'M' instead of markdownwith a small 'm'.