If you change the Hyphen in punctuation settings to either 'Replace by separator' or 'No action (do not remove)', it is always removed. The same happens to other punctuation that might be set as the punctuation separator instead.

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

Could you maybe give an example?

aaron’s picture

Title: Punctuation settings ignored when using as a separator » How to intentionally use a separator in this special circumstance?
Category: bug » support
Status: Postponed (maintainer needs more info) » Active

ah, never mind. i just realized it's a case of user error.

what i'm trying to do is create patterns using integers, which are from -n to n, including the hyphen, in the automatically generated path.

for instance, i have something like the following:

[node:field-world]/[node:field-x]/[node:field-y]

I expect it to produce results like:

beta/-67/49
beta/67/49

but it instead gives me:

beta/67/49
beta/67/49-0

how can i create a pattern like what i'm looking for?

aaron’s picture

i've tried a few other cases, and have it working after a fashion, by setting the separator to anything other than a hyphen, for instance with a period, and telling it to not remove a hyphen. however, if i then set the period to 'remove', the page tells me some paths will be broken.

aaron’s picture

that would also leave my other urls looking really ugly.

aaron’s picture

Title: How to intentionally use a separator in this special circumstance? » How to intentionally use a hyphen separator with negative integers?
Freso’s picture

Category: support » bug

Actually, I'd say that your initial example should work. With hyphen as a separator, and settings for hyphen set to "do not remove", then hyphens shouldn't be removed (unless there are two, i.e. "--", where one should be removed). Dave, do you agree?

aaron’s picture

out of curiosity, i set it as [node:field-world]/x[node:field-x]/y[node:field-y] but it gave me:

for -1, 1 beta/x1/y1
for 1, -1 beta/x1/y1-0

maybe it doesn't like a leading hyphen?

Dave Reid’s picture

Category: bug » feature

This is due to Pathauto's cleaning of separators (it cleans any multiple, leading, or trailing separators in each token's value) so supporting such an edge case is a feature request which I'm not sure we'd be able to do. :/