hArpanet / DokuWiki_st3

DokuWiki SublimeText 3 sytax highlighting
1 stars 0 forks source link

Italics RegExes #3

Open hArpanet opened 10 years ago

hArpanet commented 10 years ago

Now it starts to get more complicated. :-(

I've added a Dev branch and made it the default one. (I also added the Emoticon Grammar so I could highlight the FIXME's in the testpage.)

I have added the Grammar for Italics, with updates to the testpage. As you can see, the italics causes quite a few problems.

Any chance you can have a go at the RegExes for Italics to see if we can sort the problem?

Possibly the first thing is to stop the // in URLs from causing a problem. (I tried putting a ^:// in there to tell it not to recognise // following a colon, but that didn't work).

hArpanet commented 10 years ago

Ok, to cure the problem with URL's affecting italic markup, I've used 'lookbehind', which would give us a RegEx of: (?<!:)// to only match // when it is not preceded by a colon :

We still need to decide how to handle the other issues (bold in italic, and italic in bold). This was the original 'not cascading' issue that I was facing when I first tried to create this Syntax.

vaniwiki commented 10 years ago

We're having new years celebration in Mayapur, so it will take me a few days to catch up.

//Just from the top of my head, here are some points to address://
hArpanet commented 10 years ago

Hey, Happy New Year! (that's weird for me to say :-)

Good spotting on the :// but I'm not sure if we should bother to do anything about it. You're welcome to sort out the relevant RegEx to recognise proper URLs if you like :-) or I might just put a TODO in the code so there is a comment regarding the issue.

markup.heading change is good.

hope the party went well :-)

hArpanet commented 10 years ago

I have added a comment above italic in tmLanguage to remind about the issue with false url recognition, but don't plan on doing anything with it.

I'll also leave this issue open as recognition of the problem.

As such, I am considering that Italics is now 'fully' implemented and will look into <code> blocks next.