Modify

Opened 5 years ago

Closed 6 months ago

#5523 closed defect (fixed)

tags retain punctuation at beginning and end.

Reported by: roger@… Owned by: hasienda
Priority: normal Component: TagsPlugin
Severity: normal Keywords: tag validation strip
Cc: Trac Release: 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.

Attachments (0)

Change History (8)

comment:1 Changed 3 years ago by hasienda

  • Keywords tag validation strip added
  • Owner changed from athomas to hasienda

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: Changed 3 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 3 years ago by hasienda

I don't deny your reasons for your application.

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 23 months ago by hasienda

Replying to 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.

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 17 months ago by hasienda

#9630 has a good example to demonstrate the issue.

comment:6 Changed 17 months ago by hasienda

(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 7 months ago by hasienda

In 13730:

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

Newly added permission and resource existance awareness mimics wiki link
behavior for tickets and wiki pages.

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

comment:8 Changed 6 months ago by hasienda

  • Resolution set to fixed
  • Status changed from new to 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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.