#2532 closed defect (duplicate)
Search for Camelcase ends up with newpage (ex. search for WikiFormatter)
Reported by: | anonymous | Owned by: | Christian Boos |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | search system | Version: | 0.9.2 |
Severity: | trivial | Keywords: | Camelcase Search |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
When you search for a Word in CamelCase you get redirected to create a "new Page".
Please don't do that! (or at least provide a solution to remove it from the core-code manualy)
- It makes problems with JavaClasses, WinAPI-Functions, …
- It's neither professional nor elegant
- …
Attachments (1)
Change History (10)
comment:1 by , 19 years ago
Milestone: | 0.9.3 |
---|---|
Priority: | high → normal |
Resolution: | → invalid |
Severity: | blocker → normal |
Status: | new → closed |
comment:2 by , 19 years ago
Patch for no_camelcase (no more camel_sh*) As discussed in: #425 #476 #1490 #1604 #2526
--- wiki/api.py (Original) +++ wiki/api.py (Patch) @@ -185,7 +185,10 @@ # IWikiSyntaxProvider methods def get_wiki_syntax(self): - ignore_missing = self.config.get('wiki', 'ignore_missing_pages') + no_camelcase = self.config.get('wiki', 'no_camelcase') + if no_camelcase in TRUE: + return + ignore_missing = self.config.get('wiki', 'ignore_missing_pages') ignore_missing = ignore_missing in TRUE yield (r"!?(?<!/)\b[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+" "(?:#[A-Za-z0-9]+)?(?=\Z|\s|[.,;:!?\)}\]])",
in your trac.ini do
[wiki] no_camelcase = true
There should be a Script which converts all CamelCase (if there is a page
to it)
to [wiki:link]
and leave all others basicaly (Class Names etc.) alone…
comment:3 by , 19 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:4 by , 19 years ago
Description: | modified (diff) |
---|---|
Summary: | Search for Camelcase fails with newpage (ex. search forWikiFormatter) → Search for Camelcase ends upwith newpage (ex. search for WikiFormatter) |
Well, ignoring the offending tone of our anonymous reporter, this "feature" seems to be requested often enough (even in more polite manner) to be at least considered. While I'm not at all in this school of thought (to me, a wiki without CamelCase doesn't even look like a Wiki :) ), I think we could keep the discussion opened. That discussion is actually two fold:
- disable CamelCase entirely in the wiki (like the patch suggests)
- disable the quick jump to a Wiki page when a CamelCase word is entered. This is even considered as a feature by some, in order to be able to quickly create a new page (and of course, this is the best way to
end
up with orphaned pages…)
(/me cleaning up the description a bit…)
comment:5 by , 19 years ago
comment:6 by , 19 years ago
Milestone: | → 1.0 |
---|---|
Owner: | changed from | to
Priority: | normal → low |
Severity: | normal → trivial |
Status: | reopened → new |
I would say, let's keep this one focused on the disable the quick jump to a Wiki page when a CamelCase word is entered topic, as the summary and the description indicate. The disabling of CamelCase links is already discussed at length in #476. I'll copy there the patch proposed above, for further discussion. In the meantime, the disabling of quickjump would be something like that:
Index: Search.py =================================================================== --- Search.py (revision 2689) +++ Search.py (working copy) @@ -223,9 +223,10 @@ if re.match (r, kwd[len('wiki:'):]): return self.env.href.wiki(kwd[len('wiki:'):]) elif kwd[0].isupper() and kwd[1].islower(): - r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)" - if re.match (r, kwd): - return self.env.href.wiki(kwd) + if self.config.getbool('search', 'camelcase_quickjump'): + r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)" + if re.match (r, kwd): + return self.env.href.wiki(kwd) # IWikiSyntaxProvider methods
comment:7 by , 19 years ago
cboos: I don't think we should be special-caseing the quickjump
method
for this, but should actually be switching that method to use the
WikiSystem
's known syntax providers instead of all the hardcoded
quickjump
tests. In that case if CamelCase was disabled as a TracLinks
syntax, then it would not be recognized for the quickjump
, but I think
that all TracLinks syntaxes should be treated equally. Maybe we should
disable the quickjump when using the "Search" page and only use it on the
search box above the menu.
If you feel like dealing with this professionally you can search for the related existing tickets or ask on the MailingList or IrcChannel about this, however I don't intend to dignify this flamebait with a response.