From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88719 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Permissible characters in ConTeXt reference labels Date: Wed, 17 Sep 2014 22:26:47 -0400 (EDT) Message-ID: References: <541A08A0.1010002@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1411007240 25125 80.91.229.3 (18 Sep 2014 02:27:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 02:27:20 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 18 04:27:14 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XURRB-00067e-QZ for gctc-ntg-context-518@m.gmane.org; Thu, 18 Sep 2014 04:27:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 240B5101FA for ; Thu, 18 Sep 2014 04:27:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JWIfTCEgclF3 for ; Thu, 18 Sep 2014 04:27:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id C0B13101FD for ; Thu, 18 Sep 2014 04:27:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C7AB101E7 for ; Thu, 18 Sep 2014 04:26:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vrhm25SHAzHS for ; Thu, 18 Sep 2014 04:26:53 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 82B91101E1 for ; Thu, 18 Sep 2014 04:26:53 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s8I2QnDV029775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Sep 2014 04:26:51 +0200 Original-Received: FROM adi-tablet ((null) [135.0.226.162]) By hackers.mr.itd.umich.edu ID 541A42E8.4CC86.3206 ; Authuser adityam; 17 Sep 2014 22:26:48 EDT In-Reply-To: <541A08A0.1010002@wxs.nl> User-Agent: Alpine 2.03 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=Michigan; city=Ann Arbor; latitude=42.3241; longitude=-83.7113; http://maps.google.com/maps?q=42.3241,-83.7113&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QMQqqOnb - 385d38b71b8a - 20140918 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88719 Archived-At: On Thu, 18 Sep 2014, Hans Hagen wrote: > On 9/18/2014 12:06 AM, Mark Szepieniec wrote: >> Bump... >> >> If it's not too much trouble, I would greatly appreciate some feedback >> on this before I propose it to be merged into pandoc; even a "looks good >> to me" from one of the ConTeXt gurus would be very helpful. >> >> Thanks in advance, >> >> Mark >> >> On Tue, Sep 9, 2014 at 12:20 AM, Mark Szepieniec > > wrote: >> >> I'm trying to fix a problem in pandoc (see >> https://github.com/jgm/pandoc/pull/1589) where it doesn't properly >> sanitize the reference labels in ConTeXt output, causing errors >> during compilation when a label contains '#' for example. Note that >> this sanitizing is needed in addition to the regular backslash >> escaping used for control characters: '\#' is still illegal in a >> label for example. (LaTeX label) = (ConTeXt reference). What Mark mean was references such as \section[...]{...} or \startplacefigure[reference={...}]. >> In the sanitizer function I'm writing, I'd like to properly escape >> all illegal characters, but I couldn't find an explicit list of >> allowed or illegal characters. Based on some testing I've conducted >> (see attached file), I've arrived at the following set: >> >> \#[]",{}%()|= > > it depends on where these characters end up in > > # : always tricky as it denotes an argument, so escape > [] : depends if it gets fed into a macro that uses [] as delimiters > {} : only an issue when not balanced > % : escaping needed as it's comment otherwise > () : depends on where it ends up, like [] > | : is special in context so needs escaping > \ : of course that one needs escaping > >> 1) Does this look like a reasonable set? Are there other characters >> or sequences that should be included, or are worth testing? > > keep in mind that escapes should end up unescaped at some point > >> 2) I was told (see >> https://groups.google.com/forum/#!topic/pandoc-discuss/tYpXMUkmbEY) >> that if the characters " and , didn't work, it would count as a >> ConTeXt bug, is there any truth to that? Please let me know if any >> further info is needed on my part. > > well, define bug ... one can say the same of < and > in xml -) Since I made that comment on the pandoc mailing list, let me explain. Consider: \section["some" reference]{Title} Given how " behaves elsewhere in ConTeXt, a user would expect the above to be a valid input. If it is not, then it is bug (or atleast, surprising). The same goes for \section[some, reference]{Title} > if the result ends up in a comma separated list then , can be an issue but > one can always wrap an argument in {} to hide that > >> 3) Does anyone see issues with this general approach? I'm relatively >> new to ConTeXt, so I might be missing either a huge problem, or an >> obviously easier way to do this. > > i don't know ... i never used pandoc input Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________