typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

[feature] Support or ignore pandoc's crossref's labels #105

Open jhrmnn opened 8 years ago

jhrmnn commented 8 years ago

pandoc-crossref is a pandoc extension that adds object referencing capabilities to markdown, which is a must in scientific texts. The syntax of figure labels is ![Caption](file.ext){#fig:label} and is ignored by Typora as expected. The syntax for labels is

a   b   c
--- --- ---
1   2   3
4   5   6

: Caption {#tbl:label}

which is considered simply another paragraph by Typora, which is fine as well. For equations and section headings, however, we have $$ math $$ {#eq:label} and # Section {#sec:section} which is displayed as text by Typora.

I'm not suggesting Typora should support the referencing (maybe one day), but could we have the labels being ignored? It's most pressing for the equations, since they are not recognized as equations with the label.

abnerlee commented 7 years ago

also relates https://github.com/typora/typora-issues/issues/219

arthurrump commented 2 years ago

I think there are two issues here:

  1. Support for the : in identifiers. When I have a section # Section {#mysection} the identifier label is recognized and hidden from the outline, but with # Section {#sec:mysection} (which is the syntax required by pandoc-crossref) the identifier is no longer recognized.
  2. Support for the reference links, which are different from standard markdown links. pandoc-crossref uses the [@sec:mysection] link to reference other sections (or figures, equations etc) inspired by pandoc-citeproc.

My guess is that (1) would be very easy to implement, whereas (2) requires significant work and also requires some consideration of #912 due to the common syntax. Then there would also be the question of how to render the links, at which point you may be re-implementing pandoc-crossref logic, which might not be great. (Similar questions arise for #912.)

Anyway, if only (1) were implemented I would already be quite happy ☺️