statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.65k stars 235 forks source link

Indented fenced code blocked not processed unless in list #872

Closed hawkerm closed 2 years ago

hawkerm commented 4 years ago

If I have the following markdown:

Create a Spaceship class:

    ```java
    import java.awt.Color;
    ...
    ```

It will render the fenced blocks:

image

But if I instead make the first element an item in a list, it'll render as expected:

1. Create a Spaceship class:

    ```java
    import java.awt.Color;
    ...
    ```

image

It'll also render fine if I don't indent the code block:

Create a Spaceship class:

```java
import java.awt.Color;
...
```

image

However, I'm trying to indent the code block on the page itself.

arebee commented 4 years ago

Isn't a Wyam.io issue IMO so much as Markdown. You're pretty much stuck with using space chars in your code block to fake the indent AFAIK or use HTML directly and lose pygments. Happy to learn an alternate.

Create a Spaceship class:

```java ␠␠␠␠import java.awt.Color; ...

Will render:

Create a Spaceship class:

   import java.awt.Color;
    ...
daveaglick commented 2 years ago

I'm slowly working on cleaning up some of the issues that came over from Wyam. Since this one is pretty old I'm going to go ahead and close it. Please don't hesitate to comment or open a new one if it turns out this issue is still relevant in Statiq.