vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
812 stars 129 forks source link

Use only first word in info string to determine highlighting in fenced code blocks #879

Open publysher opened 4 years ago

publysher commented 4 years ago

According to the CommonMark specification (emphasis mine):

The first word of the info string is typically used to specify the language of the code sample[...]

All other Markdown implementation that I know of use the same approach. This allows you to add extra metadata to your code blocks:

```java highlight=suppressed
// code comes here
```

Markdown Navigator Enhanced seems to use the entire info string.

The following works:

```java
// code comes here
```

But this does not:

```java and some arbitrary info-string meta-data
// code comes here
```
vsch commented 3 years ago

@publysher, will add this to the next release

vsch commented 3 years ago

@publysher, I checked and it is already implemented to only use the first word.

image

Where are you seeing it not working properly?

publysher commented 3 years ago

It's actually about the syntax highlighting in the editor. Without a tag:

Screen Shot 2021-01-04 at 09 18 26

Note how the code has syntax highlighting and live code analysis. Not in the screenshot, but it also supports language specific intentions.

But when I add a tag:

Screen Shot 2021-01-04 at 09 18 48

Now the code no longer has syntax highlighting in the IDE.