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

Syntax revision for markdown fenced code attributes #8174

Closed
IllustratedMan-code opened this issue Jul 11, 2022 · 0 comments
Closed

Syntax revision for markdown fenced code attributes #8174

IllustratedMan-code opened this issue Jul 11, 2022 · 0 comments

Comments

@IllustratedMan-code
Copy link

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.

Siphalor added a commit to Siphalor/pandoc that referenced this issue Jul 16, 2022
This allows the combination of the fenced code block shortcut form with
attributes:

```haskell {.class #id}
```

The code syntax class will be combined with the attribute classes.

This syntax allows for more intuitive writing and for better compatibility
with other Markdown parsers such as GitHub or Codeberg.
Siphalor added a commit to Siphalor/pandoc that referenced this issue Jul 16, 2022
This allows the combination of the fenced code block shortcut form with
attributes:

```haskell {.class #id}
```

The code syntax class will be combined with the attribute classes.

This syntax allows for more intuitive writing and for better compatibility
with other Markdown parsers such as GitHub or Codeberg.
@jgm jgm closed this as completed in 8670f6d Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants