From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: The + character creating strike-through markup within in-line literal / code blocks Date: Mon, 25 Jun 2018 08:29:42 -0400 Message-ID: <87y3f3vykp.fsf@alphaville.usersys.redhat.com> References: <20180624075750.rw4ufcyv2ywbtcdj@s70206.gridserver.com> <876028twvj.fsf@nicolasgoaziou.fr> <20180625055244.63biztp4zjhgfhha@s70206.gridserver.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQd1-0006b7-WB for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 08:29:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQcy-000164-OJ for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 08:29:55 -0400 Received: from [195.159.176.226] (port=44309 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQcy-00015t-Fs for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 08:29:52 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fXQao-00062R-6c for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 14:27:38 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org John Magolske writes: >> It happens because syntax coloring is a bit dumb. It uses regexps but >> not the parser. However, if you try, e.g., to export the document, the >> plus signs will not be treated as markers. > > Ok, just tried org-html-export-as-html and see it renders properly > in html: > > ... expression (x +. y) the +. is ... > > but I feel like there's a bug in the regex, that the =code= and > ~verbatim~ marker characters should be able to prevent any other > marker characters bracketed by them from causing highlighting. Regexes recognize what is called a "regular" language which obeys a context-free grammar. Although modern regexes are a bit more powerful, it is still difficult (and computationally expensive) to have them recognize context (e.g. figure out that we are now inside a verbatim environment and so we need to do things differently). That's why context-sensitive grammars require parsers. -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler