# Simple mode and nested wiki markup

**URL:** <https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248>\
**Category:** Uncategorized\
**Created:** [May 20, 2015, 1:11am UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248 "2015-05-20T01:11:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![skiwi](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/skiwi/32/123_2.png) [@skiwi](https://discuss.codemirror.net/u/skiwi)\
**Post date:** [May 20, 2015, 1:11am UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248/1 "2015-05-20T01:11:35Z")

</div>

When using simple mode is there a way of persisting markup highlighting from the start token to the end token?  
For example, with the (PmWiki) markup ‘^superscript markup^’ and ‘_bold markup_’

With the nested markup  
’\* bold and some ‘^superscript^’ markup\*'  
then only the bold shown.

Using simple mode as follows  
{regex: /’\*._?\*’/, token: “pm-bold”},  
{regex: /’^._?^’/, token: “pm-sup”},

thanks

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [May 20, 2015, 7:50am UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248/2 "2015-05-20T07:50:03Z")

</div>

This isn’t a use case that has come up yet for the simple mode system, and it indeed can’t handle it. Matching markup is generally a very different problem from matching programming languages, so I’m not sure if trying to extend the simple mode language to cover it is a good idea. I think the best way forward is to write a classical, programmatic mode for your markup language.

---

<div class="post-metadata">

**Author:** ![hacdias](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/hacdias/32/386_2.png) [@hacdias](https://discuss.codemirror.net/u/hacdias)\
**Post date:** [August 19, 2017, 3:19pm UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248/3 "2017-08-19T15:19:41Z")

</div>

Hello @skiwi!

I’m having the same trouble. How did you solve it? 😃

---

<div class="post-metadata">

**Author:** ![skiwi](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/skiwi/32/123_2.png) [@skiwi](https://discuss.codemirror.net/u/skiwi)\
**Post date:** [August 19, 2017, 11:02pm UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248/4 "2017-08-19T23:02:49Z")

</div>

I didn’t solve the problem,  
I had hoped that it might be possible to enhance the simple markup for simple cases like this.  
Marijn’s response is that this isn’t to be.  
I don’t have the resources to develop a ‘classic programmatic mode for my markup language’,  
so I’ve let it lapse.

---

<div class="post-metadata">

**Author:** ![hacdias](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/hacdias/32/386_2.png) [@hacdias](https://discuss.codemirror.net/u/hacdias)\
**Post date:** [August 20, 2017, 7:09am UTC](https://discuss.codemirror.net/t/simple-mode-and-nested-wiki-markup/248/5 "2017-08-20T07:09:06Z")

</div>

I see. Thanks anyway. I was also [trying to create](https://discuss.codemirror.net/t/create-a-custom-mode/1334/2) a mode with nested markup but I’m not seeing how to do it .
