Codeblock with '*' in it will break code colorization


#1

Example


Autologin

sudo vi /etc/lightdm/lightdm.conf
# under [Seat:*] enable
autologin-user=yourUserName

Any solutions? Would that be a bug?


#2

Are you talking about highlighting in Atom? What language are you using? Mind sharing a screenshot?


#3

It says github markdown.


#4

It’s because the language package that Atom is using isn’t matching the indented section as anything special. Since the indentation is part of the main flow of text, the highlighter sees an unbroken string of text from the first * to where the actual italics tag is.

You can probably fix it by switching from indentation to backtick-fencing for your code segments. I use a different language package, language-markdown, which doesn’t break in that way.


#5

Hello.

Should that piece not be in code quotes?

```text
This is some text with * included.
```

Alternatively try typing \ before the *
\* ----------------> *
The same apply for \- to get - at the start of a line.

- Dan


#6

* Notation will be rendered literaly then (at least jekyll does that. @Damned; Will try.


#7

@Damned; That is a bit better, but still far from perfect, for example a code block like

do that && do this

will render with some unwanted red, oh well.

p.s. Issue is still the same with original build-in markdown in 1.20.1

@dan; I don’t know, isn’t the beauty of (original) markdown exactly in it’s simplicity?


#8

Could you paste the raw text in here to test with?..

For example

```text
# Install Debian 9
[Official iso](www.link1.io) or [with non-free firmware](www.link2.io)

    md5sum *.iso # or
    md5sum -c MD5SUMS
    # firmware.iso: OK
    
Install base system,<br>
select *standard* and *server* if you so wish
```

For the above give me the following result:

Inside this topic it renders as:

Install Debian 9

Official iso or with non-free firmware

md5sum *.iso # or
md5sum -c MD5SUMS
# firmware.iso: OK

Install base system,

select standard and server if you so wish

Have a look at the packages that I am using.
Maybe it is helpful to you.


Side-note:
when you use @dan instead of @danPadric, you call a ‘stranger’ to the party.


#9

What unwanted red?

p.s. Issue is still the same with original build-in markdown in 1.20.1

Have you tried language-markdown?


#10

Disclaimer: I read the title and skipped the posts

This is a known bug that has no sane fix. If you want to get technical, it’s because language-c uses $base matching. $base is special in that it refers to the calling grammar rather than itself (as $self does). In most cases, it is C itself or C++. However, when you put it in a Markdown document…it refers to language-gfm, and so everything starts being tokenized as Markdown instead of C.