lierdakil/pandoc-crossref

place pandoc crossref attributes in new line

fcskit opened this issue · 1 comments

fcskit commented

This is not a major issue but it would be nice if a single line break would be supported between a markdown heading or figure and a pandoc crossref attribute in curly brackets.
Currently I'm receiving an error if I place a section {#sec:seclabel} or figure attribute {#fig:label} in a new line directly after a heading or figure.

So this works:

# Heading {#sec:seclabel}
![image caption](link_to_image.png){#fig:figlabel}

but this won't

# Heading
{#sec:seclabel}

![image caption](link_to_image.png)
{#fig:figlabel}

Personally the latter is more readable to me. In particular since some markdown editors support some kind of live preview and having a heading rendered in bold letters and large font size including a {#sec:seclabel} attribute just doesn't look very nice.

Pandoc can't parse this, so nothing I could do on pandoc-crossref side. Feel free to take this upstream

But there are issues with the proposed syntax, e.g.

# ![image caption](link_to_image.png)
{#somelabel}

what's this? There's ambiguity.

With the current setup, image attributes require no whitespace between the image and {, so this is not ambiguous:

# ![image caption](link_to_image.png) {#somelabel}