Confused Syntax highlighting in markdown

49 views
Skip to first unread message

Rainer Krug

unread,
Mar 21, 2022, 9:49:14 AM3/21/22
to BBEdit Talk
Hi

I see the following confused syntax highlighting in a Markdown document.



Screenshot 2022-03-21 at 14.45.33.png

Is this a bug, or a limitation (LaTeX math, underscores as underscores in the text, ... ?

Any suggestions? as this is extremely irritating.

Below is the text so that others can try it out:

We use the notation from the [Table S1](LINK NEEDED) of the Supplementary information of [@Bush2017]), and not the notation in the main manuscript of [@Bush2017]. In the main manuscript the notation is simplified to `y_S_PB` ($y_{S,PB}$) (which is `y_SR_PB` ($y_{SR,PB}$) in Table S1) and `y_S_SB` ($y_{S,SB}$) (which is y_SO_SB ($y_{SO,SB}$) in Table S1). We also use `Pr_cB` ($Pr_B$) instead of `P_CB` ($P_{CB}$).

All parameter and variables follow these base dimensions:

- Time: `hours`
- Volume: `litres`
- Substrate quantity: `micromoles`
- Organism quantity: `cells`




Rich Siegel

unread,
Mar 21, 2022, 10:12:33 AM3/21/22
to BBEdit Talk
On 21 Mar 2022, at 9:49, Rainer Krug wrote:

> Is this a bug, or a limitation (LaTeX math, underscores as underscores in
> the text, ... ?

It's legal Markdown syntax: <https://daringfireball.net/projects/markdown/syntax#em>.

Emphasis can be used in the middle of a word:

un*frigging*believable

R.

Rainer Krug

unread,
Mar 21, 2022, 10:16:25 AM3/21/22
to BBEdit Talk
But is than the confused syntax highlighting syntax a bug? Because when in the preview, it looks as expected

Screenshot 2022-03-21 at 15.15.59.png

Rainer Krug

unread,
Mar 21, 2022, 10:17:13 AM3/21/22
to BBEdit Talk
Or: how can I have a `_` as a `_` and not as markup?

On Monday, March 21, 2022 at 3:12:33 PM UTC+1 sie...@barebones.com wrote:

Rich Siegel

unread,
Mar 21, 2022, 10:26:32 AM3/21/22
to BBEdit Talk
On 21 Mar 2022, at 10:16, Rainer Krug wrote:

> But is than the confused syntax highlighting syntax a bug?

It is (currently) the intended behavior.

> Because when in
> the preview, it looks as expected

The default preview renderer is `cmark`, which implements a slightly different Markdown specification. Using "classic" `Markdown.pl` will likely show output consistent with the coloring (but is slower).

R.
Reply all
Reply to author
Forward
0 new messages