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

Support Pandoc's Raw Attribute #225

Open
kylebarron opened this issue Jun 19, 2018 · 3 comments
Open

Support Pandoc's Raw Attribute #225

kylebarron opened this issue Jun 19, 2018 · 3 comments

Comments

@kylebarron
Copy link
Contributor

kylebarron commented Jun 19, 2018

The Readme says that this package supports R Markdown, which to me means that it implicitly supports Pandoc's Markdown. Assuming that's true, 1) it might be nice to add Pandoc's Markdown to the list of supported grammars, and 2) there are some new syntax options that Pandoc 2 brought that aren't highlighted. For example the Raw Attribute extension.

Inline spans and fenced code blocks with a special kind of attribute will be parsed as raw content with the designated format. For example, the following produces a raw groff ms block:

```{=ms}
.MYMACRO
blah blah
```

It would be helpful to include XML, LaTeX, HTML within these blocks. For example,

```{=latex}
\begin{center}
\begin{tabular}{ c c c }
 cell1 & cell2 & cell3 \\ 
 cell4 & cell5 & cell6 \\  
 cell7 & cell8 & cell9    
\end{tabular}
\end{center}
```

should be highlighted as LaTeX. I wouldn't expect this to interfere with any current functionality of the package. I can submit a PR if you're interested.

@allefeld
Copy link

allefeld commented Jan 2, 2020

I second this. I use the package to edit files in Pandoc's Markdown, and as far as I can see, most of the syntax is supported already. But sometimes there are a few things that don't work. One example: emphasis * * within description-list items. I don't think I'm able to patch the package myself, but if there is something I can do to help, I'd be happy to.

@stefanocoretta
Copy link

As a temporary solution (minimally tested, so might break things), replace all occurrences of ^\\s*([`~]{3,})\\s*(\\{?) to ^\\s*([`~]{3,})\\s*(\\{?=?) in grammars/language-markdown.json of your local installation of the package. (It will be overwritten when updating the package).

@burodepeper
Copy link
Owner

@stefanocoretta Would you mind testing your solution a little further and submitting it as a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants