idea-multimarkdown icon indicating copy to clipboard operation
idea-multimarkdown copied to clipboard

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

Open publysher opened this issue 4 years ago • 3 comments

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
```

publysher avatar Aug 20 '20 07:08 publysher

@publysher, will add this to the next release

vsch avatar Sep 19 '20 20:09 vsch

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

image

Where are you seeing it not working properly?

vsch avatar Sep 22 '20 12:09 vsch

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.

publysher avatar Jan 04 '21 08:01 publysher