gnab / remark

A simple, in-browser, markdown-driven slideshow tool.
http://remarkjs.com
MIT License
12.71k stars 857 forks source link

list with source code avoid slide break #445

Open flashpixx opened 7 years ago

flashpixx commented 7 years ago

I have build a list in markdown with source code inside the list items and after the list comes the slide break

* foo
   ```java
   int x = 5;
   ```
* bar

---

but on this structure the slide break will not be done, it create a <hr> on the remarkjs view. I add the following CSS style of the ``

``` to solve problem temporary:

h5 {
    font-weight: normal;
    display: list-item;
    list-style-position: inside;
}

With this I declare my list items as h5 headers

yeputons commented 4 years ago

Kludgy workaround is to alter lexer.js:21:

Before:

    FENCES: /(?:^|\n) *(`{3,}|~{3,}) *(?:\S+)? *\n(?:[\s\S]+?)\s*\4 *(?:\n+|$)/,

After:

    FENCES: /(?:^|\n)[ *]*(`{3,}|~{3,}) *(?:\S+)? *\n(?:[\s\S]+?)\s*\4 *(?:\n+|$)/,

I allowed a code block to start from a sequence of spaces and asterisks followed by ```

Previously it picked up the second ``</code> as the start and ignored---` as it's "inside" the code.