# SimpleMDE Markdown Editor for Kirby

**URL:** <https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096>\
**Category:** Plugins\
**Created:** [November 24, 2017, 12:03pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096 "2017-11-24T12:03:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [November 24, 2017, 12:03pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/1 "2017-11-24T12:03:37Z")

</div>

I completely rewrote my Enhanced Textarea field:  
[https://github.com/medienbaecker/kirby-simplemde](https://github.com/medienbaecker/kirby-simplemde)

It’s using the amazing [SimpleMDE Markdown Editor](https://github.com/sparksuite/simplemde-markdown-editor), customized and optimized for Kirby.

**Preview:**

 ![out](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/5bc49f13847fd19708a409c106067b8c9f39376b.gif)

**Features:**

- Live Markdown highlighting. Including green Kirbytags.
- Undo/redo via Ctrl/⌘ + Z/Y.
- No modals for URLs and email addresses as this prevents the buttons from showing in structure fields.
- Automatic link/email detection when selecting text and using the link or email button.
- Easy to add custom buttons
- Sticky toolbar on the top for better reachability

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 24, 2017, 12:13pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/2 "2017-11-24T12:13:30Z")

</div>

Looks great. Is it possible to disable the green highlighting with a config setting? Looks like it has no page button anymore…

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [November 24, 2017, 12:18pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/3 "2017-11-24T12:18:36Z")

</div>

Disabling the green highlighting is not possible right now, but I will add an issue and try to add this functionality. I might be able to optimize the visuals though — why exactly do you want to disable it?

I want to completely move away from modals for this rewrite. That’s why the page button is not yet implemented. I have a local proof-of-concept displaying the page list inside the toolbar. Keep an eye on this issue: [https://github.com/medienbaecker/kirby-simplemde/issues/2](https://github.com/medienbaecker/kirby-simplemde/issues/2)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 24, 2017, 12:21pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/4 "2017-11-24T12:21:07Z")

</div>

> [@thguenther](#):
>
> why exactly do you want to disable it?

For me, it would be too distracting from the content to have highlighting within the text.

> [@thguenther](#):
>
> Keep an eye on this issue: [https://github.com/medienbaecker/kirby-simplemde/issues/2](https://github.com/medienbaecker/kirby-simplemde/issues/2)

I definitely will 🙂

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [November 24, 2017, 12:30pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/5 "2017-11-24T12:30:59Z")

</div>

Nice! 🙂 I hope you will continue with this field to future versions of Kirby as well.

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [November 24, 2017, 12:44pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/6 "2017-11-24T12:44:30Z")

</div>

@texnixe I added an option to disable the Kirbytag highlighting:  
`c::set('simplemde.kirbytagHighlighting', false);`

@jenstornell Thank you! I hesitated at first because of Kirby 3 — maybe this field will not even be needed anymore. But I thought it would be a great project for my first Kirby 3 plugin. It’s very straight forward and not as bloated as the Enhanced Textarea.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 24, 2017, 12:48pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/7 "2017-11-24T12:48:11Z")

</div>

> [@thguenther](#):
>
> I added an option to disable the Kirbytag highlighting:
> 
> c::set(‘simplemde.kirbytagHighlighting’, false);

Wonderful! You are fantastic!

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [November 25, 2017, 10:06pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/8 "2017-11-25T22:06:39Z")

</div>

I have now implemented a completely different page link functionality and released [version 1.1](https://github.com/medienbaecker/kirby-simplemde):

![pagelink](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/594c89bcf7066202afd1f8462e573e822f93fe87.gif)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 25, 2017, 10:08pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/9 "2017-11-25T22:08:18Z")

</div>

Very cool 🕶 (and some more chars)

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [November 28, 2017, 2:07pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/10 "2017-11-28T14:07:52Z")

</div>

This is amazing! No more reason to feel wary of using kirby builder for text-heavy blocks!

(though I’m sure Kirby 3 will implement a kirby-builder system built-in 😛 )

Thank you

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [December 1, 2017, 9:55am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/11 "2017-12-01T09:55:58Z")

</div>

@thguenther

how would you go to implement a custom button?

I need to add one for the `code` syntax (by using inline code like `text`).

Should I extend [editor.js](https://github.com/medienbaecker/kirby-simplemde/blob/master/simplemde/assets/js/editor.js)?

Thanks!

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [December 1, 2017, 10:46am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/12 "2017-12-01T10:46:08Z")

</div>

@afincato I just added a `code` button in the `editor.js` and released [version 1.3.8](https://github.com/medienbaecker/kirby-simplemde).

As there is already a code function in SimpleMDE it was very easy. But adding more buttons is quite straight forward too. Just have a look at the existing button functions.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [December 1, 2017, 10:51am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/13 "2017-12-01T10:51:02Z")

</div>

Great thank you.

Therefore, `editor.js` is the file to work with whenever you want to extend the plugin with custom buttons? Cool. Will look at simplemd’s readme as well.

---

<div class="post-metadata">

**Author:** ![raschid](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/raschid/32/10058_2.png) [@raschid](https://forum.getkirby.com/u/raschid)\
**Post date:** [December 14, 2017, 8:47am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/14 "2017-12-14T08:47:57Z")

</div>

When you use this plugin on a textarea with **validate: minLength/maxLength** the counter does not count up/down any more …

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [December 14, 2017, 9:46am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/15 "2017-12-14T09:46:21Z")

</div>

@raschid I just added the live validation script and released [version 1.3.11](https://github.com/medienbaecker/kirby-simplemde).  
Please let me know if this works for you.

---

<div class="post-metadata">

**Author:** ![raschid](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/raschid/32/10058_2.png) [@raschid](https://forum.getkirby.com/u/raschid)\
**Post date:** [December 14, 2017, 11:41am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/16 "2017-12-14T11:41:48Z")

</div>

@thguenther tried it on 2.5.5 and validator-count works on normal textarea and on textarea in a modal (structure).

Validator maxLength works as expected. Thanks!

And the Problem I hat this morning ([klick](https://forum.getkirby.com/t/panelfield-blueprints-validate-number-of-accepted-chars-lower-than-maxlength/9263/3)) disappeared!

---

<div class="post-metadata">

**Author:** ![ryuchix](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ryuchix/32/4732_2.png) [@ryuchix](https://forum.getkirby.com/u/ryuchix)\
**Post date:** [December 19, 2017, 9:12am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/17 "2017-12-19T09:12:34Z")

</div>

@thguenther  
issues in simpleMDE

> [@SimpleMDE plugin issues in kibry 2.5.8 making panel field super wide](https://forum.getkirby.com/t/simplemde-plugin-issues-in-kibry-2-5-8-making-panel-field-super-wide/9290):
>
> i found a bug… im using kirby version 2.5.8 When SimpleMDE field is on, it makes the whole edit area super wide. [22 PM]

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [January 3, 2018, 9:37pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/18 "2018-01-03T21:37:26Z")

</div>

SimpleMDE seems to not find the `translation.json` files because the path set is wrong.

`http://website/panel/plugins/simplemde/translation.json`

I am not using any custom routing.

Happening only to me?

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [January 4, 2018, 10:46am UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/19 "2018-01-04T10:46:35Z")

</div>

It works for me.  
If it can’t find the `translation.json` on your installation, it probably won’t find the `index.json` for the page link search either.

Can you access the files directly?

The panel routes are defined in [line 16](https://github.com/medienbaecker/kirby-simplemde/blob/master/simplemde.php#L16) and [line 33](https://github.com/medienbaecker/kirby-simplemde/blob/master/simplemde.php#L33) of the simplemde.php and a data-json attribute with the url is added to the field.  
Maybe there’s a better way of adding panel routes? I couldn’t find anything in the documentation about that.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [January 4, 2018, 12:52pm UTC](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096/20 "2018-01-04T12:52:06Z")

</div>

Yes, I cannot use the search page inline toolbar as well.

How can I go about to debug it? I installed it with `kirby cli`.

[Next page](https://forum.getkirby.com/t/simplemde-markdown-editor-for-kirby/9096.md?page=2)
