pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Syntax revision for markdown fenced code attributes

Open IllustratedMan-code opened this issue 3 years ago • 0 comments

Describe your proposed improvement and the problem it solves. The current method of defining fenced code attributes breaks syntax highlighting in git hosting sites (tested in github, codeberg).

For example:

```{.python tangle="output.py"}
print("hi there")
```

renders as

print("hi there")

I propose a minor change to the syntax that is already partially supported:

```python {tangle="output.py"}
print("hi there")
```

Which renders as:

print("hi there")

Code blocks of the form:

```python
print("hi there")
```

already work in pandoc, but additional attributes are not parsed as attributes, they are parsed as part of the codeblock text.

Describe alternatives you've considered. The pandoc-entangled repository works around this problem by specifying a custom link before code blocks. This is definitely not ideal, because it breaks write format interchangeability within pandoc.

IllustratedMan-code avatar Jul 11 '22 13:07 IllustratedMan-code