fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

hyphen in labels #23

Closed jcoulombe closed 13 years ago

jcoulombe commented 13 years ago

[continued from the MMD Discussion Group]

labels with non ascii (but legal latex/html) characters are transformed in some weird way. Please notice the - that gets converted to null.

There are limitations to what can (easily) be translated. I improved the print_raw_element function so that the "null" doesn't appear, but the hyphen will simply be left out.

The hyphen, however, remains in the link, which gets broken.

$ cat hyphen.txt 
Link to [](#figure-1).

![figure-1][]

[figure-1]: file.png

$ cat hyphen.txt | multimarkdown -t latex
Link to \autoref{figure-1}.

\begin{figure}
\begin{center}
\includegraphics[keepaspectratio,width=\textwidth, height=.75\textheight]{file.png}
\end{center}
\label{figure1}
\end{figure}
fletcher commented 13 years ago

That's because you manually specified the link using an explicit link syntax []().

MMD doesn't interpret what's in there.