Opened 9 years ago

Closed 4 years ago

tags retain punctuation at beginning and end.

Reported by: Owned by: roger@… Steffen Hoffmann normal TagsPlugin normal tag validation strip 0.11

Description

It seems that the plugin only splits text with white space. So, the text "word" and "word," are treated differently.

This becomes apparent if I include the summary in the choice of words.

I think punctuation (,;.:-_'") at the beginning and end of a word needs to be stripped away. I do not think it should be removed inside a word. But I cannot see that it is a meaningful part of a tag at the beginning or end of the tag.

comment:1 Changed 7 years ago by Steffen Hoffmann

Keywords: tag validation strip added changed from Alec Thomas to Steffen Hoffmann

Could we agree on an optionally strict (sanitizing) and loose (current) treatment of tag input to not break things for someone else?

If this is not more an enhancement than a defect is debatable too, from my point of view.

comment:2 follow-up:  4 Changed 7 years ago by anonymous

So if a sentence ends with a word, it is in one tag, and if it is somewhere else in the sentence it is a different tag? I really fail to see the logic. Without this, things like generating tags from ticket summaries is not possible. I do not think it makes sense to say summaries cannot contain punctuation.

comment:3 Changed 7 years ago by Steffen Hoffmann

But this is not necessarily the requirement of all application. Are you sure, that no TracTags application relies on some form of symbols (even consider i18n) for differentiation of tags? I'm not. At least we'll need to configure, what symbols should be subject to stripping (quite easy), right?

comment:4 in reply to:  2 Changed 6 years ago by Steffen Hoffmann

So if a sentence ends with a word, it is in one tag, and if it is somewhere else in the sentence it is a different tag? I really fail to see the logic. Without this, things like generating tags from ticket summaries is not possible.

Ok, point taken. I've some changes to make this happen, but these will require some more work due to compatibility issues with older Trac versions.

comment:5 Changed 5 years ago by Steffen Hoffmann

#9630 has a good example to demonstrate the issue.

comment:6 Changed 5 years ago by Steffen Hoffmann

(In [13129]) TagsPlugin: Add unit testing for the tag: TracWiki link resolver, refs #3624, #5523 and #9630.

Currently failing two of the tests due to known issues.

Ryan's proposed patch in #10612 has been helpful to get this done too.

comment:7 Changed 4 years ago by Steffen Hoffmann

In 13730:

TagsPlugin: Reworked wiki link resolver code, refs #3624, #5523 and #9630.

behavior for tickets and wiki pages.

Unit tests have been refactored too, partially with more reasonable test cases.

comment:8 Changed 4 years ago by Steffen Hoffmann

Resolution: → fixed new → closed

In 13815:

TagsPlugin: Completing preparation for v0.7 release.

Availability of that code as stable, tagged release
closes #2429, #3359, #3610, #3624, #3677, #3754, #3864, #3947, #3983, #4078, #4277, #4503, #4799, #5523, #7787, #7857, #8638, #9057, #9058, #9059, #9060, #9061, #9062, #9063, #9149, #9210, #9521, #9630, #9636, #10032, #10416, #10636, #11096, #11147, #11152, #11274, #11302, #11658 and #11659.

Additionally there are some issues and enhancement requests showing progress,
but known to require more work to resolve them satisfactorily, specifically
refs #2804, #4200, #8747 and #9064.

Thanks to all contributors and followers, that enabled and encouraged a good
portion of this development work.

Modify Ticket

Change Properties