Lukasa / language-restructuredtext

A ReStructuredText syntax package for Atom
MIT License
27 stars 15 forks source link

Highlighting breaks when inline code directive content ends in a colon #52

Closed stadelmanma closed 7 years ago

stadelmanma commented 7 years ago

This issue pops up when ever an in-line code directive is used that ends in a colon without a space. The following cause issue:

:code:`:`
:code:`foobar:`

image

But this does not:

:code:`:foobar`
:code:`foo: bar`
:code:`foo bar:`

image

Alhadis commented 7 years ago

What's the expected behaviour for reStructuredText?

I've become rusty in my knowledge of the language, lately... sorry... :(

stadelmanma commented 7 years ago

I believe it is should still behave like a regular inline literal.

Although, I must confess I didn't know about the double backtick literals until about an hour ago when I was picking through the grammar, which are a much better fit for my use case. Granted might still be worth a fix.

Alhadis commented 7 years ago

It's queued on my todo list.

Alhadis commented 7 years ago

@stadelmanma Do you mind if I include portions of the .rst file you were editing as a fixture for package specs? Just to help guard against regressions...

stadelmanma commented 7 years ago

You are more than welcome to use all the bits and pieces you need. I am currently revising my README's and examples so you might need to go back to an older commit depending on what all I change as I rework them.

Alhadis commented 7 years ago

Ah, thank you! :) Wanted to make sure there weren't any licensing restrictions attached to my copy+pasta, heh.

I generally prefer to test using real-world examples whenever possible.

Alhadis commented 7 years ago

Fun fact: writing grammar specs is a serious pain-in-the-arse.

It goes into overdrive when you spend half the day thinking you've concocted a clever shortcut, only to spend the other half failing to get it working. It's now 1:30 am and I'm wondering where the hell my last 24 hours went.

... fuck the specs, I'm just gonna fix these bugs and cut a release. Christ... :(

Alhadis commented 7 years ago

I was worried this would take hours, but literally the first thing I tried fixed it.

Figure 1 Figure 2

And it was a 1-character fix.