ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mark Szepieniec <mszepien@gmail.com>
To: ntg-context@ntg.nl
Subject: Permissible characters in ConTeXt reference labels
Date: Tue, 9 Sep 2014 00:20:45 +0200	[thread overview]
Message-ID: <CAE4-1rVn7gf-9URqN5Zk8GiG7ujZh2RR8t=f6e2ki9hJ+Lk1xg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1228 bytes --]

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.

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:

\#[]",{}%()|=

1) Does this look like a reasonable set? Are there other characters or
sequences that should be included, or are worth testing?

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.

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.

Thanks,

Mark

[-- Attachment #1.2: Type: text/html, Size: 1617 bytes --]

[-- Attachment #2: test.tex --]
[-- Type: application/x-tex, Size: 1944 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

             reply	other threads:[~2014-09-08 22:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 22:20 Mark Szepieniec [this message]
2014-09-17 22:06 ` Mark Szepieniec
2014-09-17 22:18   ` Hans Hagen
2014-09-18  2:26     ` Aditya Mahajan
2014-09-18 12:39       ` Mark Szepieniec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAE4-1rVn7gf-9URqN5Zk8GiG7ujZh2RR8t=f6e2ki9hJ+Lk1xg@mail.gmail.com' \
    --to=mszepien@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).