From nzskiwi at gmail.com Fri Jan 6 21:43:04 2012 From: nzskiwi at gmail.com (Simon) Date: Sat, 7 Jan 2012 16:43:04 +1300 Subject: [pmwiki-devel] Anchors Message-ID: I'm looking at stdmarkup.php ## [[#anchor]] Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', "Keep(TrackAnchors('$1') ? '' : \"\", 'L')"); and http://www.w3.org/TR/html4/types.html#type-name I'm trying to get an anchor such as [[#Mangatainoka?Herepai?Ruapae]] to work, (seems reasonable to me). I'm not clear about how this regex works, but my studied interpretation is (?> ---- no backtrack, but not really clear why () is required \\[[\\[[# to \\]]\\]] ---- is the scope of the expression (not sure what /e does) [A-Za-z] ---- anchor name has to start with A-Za-z, followed by [-.:\\w] ---- character set of hyphen period colon and "word character" A-Za-z0-9_, not sure why there is a \\ (escaped \) * ---- repeat 0 or more times so it looks like my anchor should work? any suggestions appreciated thanks Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.rankin at affinity.co.nz Fri Jan 6 21:56:06 2012 From: john.rankin at affinity.co.nz (John Rankin) Date: Sat, 7 Jan 2012 16:56:06 +1300 (NZDT) Subject: [pmwiki-devel] Anchors In-Reply-To: References: Message-ID: <55bf490f8fad552f53bac14b08941d66.squirrel@intranet.affinity.co.nz> It's because the "hyphens" aren't in fact hyphens, but special characters. Perhaps the anchor was copied and pasted from another place that "smartens" what an author writes, such as Microsoft Word? To get the anchor to work as posted, I had to delete the "hyphen" and replace it with a - > I'm looking at stdmarkup.php > ## [[#anchor]] > Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', > "Keep(TrackAnchors('$1') ? '' : \"\", 'L')"); > > and http://www.w3.org/TR/html4/types.html#type-name > > I'm trying to get an anchor such as > > [[#Mangatainoka???Herepai???Ruapae]] > to work, (seems reasonable to me). > -- John Rankin From nzskiwi at gmail.com Fri Jan 6 22:22:41 2012 From: nzskiwi at gmail.com (Simon) Date: Sat, 7 Jan 2012 17:22:41 +1300 Subject: [pmwiki-devel] Anchors In-Reply-To: <55bf490f8fad552f53bac14b08941d66.squirrel@intranet.affinity.co.nz> References: <55bf490f8fad552f53bac14b08941d66.squirrel@intranet.affinity.co.nz> Message-ID: You are right, thank you, and a happy kiwi summer to you Simon On 7 January 2012 16:56, John Rankin wrote: > It's because the "hyphens" aren't in fact hyphens, but special characters. > Perhaps the anchor was copied and pasted from another place that > "smartens" what an author writes, such as Microsoft Word? > > To get the anchor to work as posted, I had to delete the "hyphen" and > replace it with a - > > > I'm looking at stdmarkup.php > > ## [[#anchor]] > > Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', > > "Keep(TrackAnchors('$1') ? '' : \"\", 'L')"); > > > > and http://www.w3.org/TR/html4/types.html#type-name > > > > I'm trying to get an anchor such as > > < > http://ttc.org.nz/pmwiki/pmwiki.php/TararuaFootprints/MangatainokaValley> > > [[#Mangatainoka?Herepai?Ruapae]] > > to work, (seems reasonable to me). > > > -- > John Rankin > > -- ____ http://kiwiwiki.co.nz -------------- next part -------------- An HTML attachment was scrubbed... URL: