veged / shmakowiki

Yet another wiki dialect, inspired by WackoWiki and WikiCreole
http://clubs.ya.ru/4611686018427414227/
13 stars 4 forks source link

In-list extension blocks #17

Closed diunko closed 11 years ago

diunko commented 11 years ago

There's a lot to discuss on how blocks inside lists should behave. What blocks are valid inside lists and how to treat them, e.g. headers, paragraphs?

Anyhow, here is a first take on implementation. It behaves in somewhat pythonic way: extension block is treated as nested if opening extension mark has more spaces in front of it then containing list bullet has. Spaces before statements inside extension block are cut off upto the point where starting extension mark lies. Spaces before closing extension mark don't matter.

I.e. extension block here

* list
 * something:
  %%hljs
^^
    var a=10;
^^^^
 %%

gets translated into

<ul>
  <li>list
    <ul>
      <li>something
<pre>
  var a=10;
^^
</pre>
</li></ul></li></ul>
diunko commented 11 years ago

/cc @arikon @afelix

arikon commented 11 years ago

@diunko Pythonic-like behavior is OK IMO. But headers should break lists.

arikon commented 11 years ago

@diunko What about simple text? Does it work also (no such case in tests for now)?

diunko commented 11 years ago

What if we try to define intended behavior more precisely here https://github.com/veged/shmakowiki/pull/18?

arikon commented 11 years ago

Please reopen pull request to the master branch

arikon commented 11 years ago

@diunko Will you reopen PR?