Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra-space between fenced code block start and attributes #7616

Closed
kdeldycke opened this issue Oct 9, 2021 · 3 comments
Closed

Extra-space between fenced code block start and attributes #7616

kdeldycke opened this issue Oct 9, 2021 · 3 comments
Labels

Comments

@kdeldycke
Copy link

kdeldycke commented Oct 9, 2021

Here is a collection of fenced code blocks in Markdown:

$ cat ./fenced-code-block-attributes.md

```shell-session
cp --help
```

``` shell-session
cp --help
```

```{.shell-session}
cp --help
```

``` {.shell-session}
cp --help
```

To normalize the style of their attributes, I ran pandoc:

$ pandoc ./fenced-code-block-attributes.md --to=markdown

``` shell-session
cp --help
```

``` shell-session
cp --help
```

``` shell-session
cp --help
```

``` shell-session
cp --help
```

Notice how each code block header gets normalized to ``` shell-session, i.e. a triple-quote followed by a space then by the language attribute.

I think this is a bug, and I expect the extra space to not be there.

For reference I use the latest pandoc on macOS Big Sur:

$ pandoc --version
pandoc 2.14.2
Compiled with pandoc-types 1.22, texmath 0.12.3.1, skylighting 0.11,
citeproc 0.5, ipynb 0.1.0.1
@kdeldycke kdeldycke added the bug label Oct 9, 2021
@jgm
Copy link
Owner

jgm commented Oct 10, 2021

Why is it a bug? The space is allowed and (I think) looks nicer.

@kdeldycke
Copy link
Author

Sorry @jgm for this nitpicking! 🙇

I was just under the impression that the non-space version ```shell-session was the canonical form of fenced blocks. I was misled by unforgiving implementation of some markdown librairies. But it seems that, indeed, spaces are allowed between triple-quotes and attributes. I now have to track down that bug on third-party libraries. 😣

Again sorry for the noise and feel free to close that issue. 😅

@jgm
Copy link
Owner

jgm commented Oct 10, 2021

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants