Opened 7 years ago

Closed 7 years ago

#12938 closed defect (fixed)

Completion doesn't work on `wiki:` link with digits, minus, dot and unicode characters

Reported by: Jun Omae Owned by: Peter Suter
Priority: normal Component: WikiAutoCompletePlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0


I think we should use \S* pattern rather than [\w/]*.

diff --git a/wikiautocomplete/htdocs/js/wikiautocomplete.js b/wikiautocomplete/htdocs/js/wikiautocomplete.js
index dac2c4c..e68f894 100644
--- a/wikiautocomplete/htdocs/js/wikiautocomplete.js
+++ b/wikiautocomplete/htdocs/js/wikiautocomplete.js
@@ -54,7 +54,7 @@ jQuery(document).ready(function($) {

         { // Wiki pages
-            match: /\bwiki:([\w/]*)$/,
+            match: /\bwiki:(\S*)$/,
             search: function (term, callback) {
                 $.getJSON(wikiautocomplete.url + '/wikipage', { q: term })
                     .done(function (resp) { callback(resp); })

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by Peter Suter

Sounds good to me!

comment:2 Changed 7 years ago by Peter Suter

From comment:2:ticket:12928:

Also, I use - character in repository name. In this case, completion doesn't work.

  • wikiautocomplete/htdocs/js/wikiautocomplete.js

    diff --git a/wikiautocomplete/htdocs/js/wikiautocomplete.js b/wikiautocomplete/htdocs/js/wikiautocomplete.js
    index 2b14015..bcb282a 100644
    a b jQuery(document).ready(function($) { 
    6363        },
    6565        { // Source
    66             match: /\b(source:|log:)([\w/.]*(?:@\w*)?)$/,
     66            match: /\b(source:|log:)([^@\s]*(?:@\S*)?)$/,
    6767            search: function (term, callback) {
    6868                $.getJSON(wikiautocomplete_url + '/source', { q: term })
    6969                    .done(function (resp) { callback(resp); })

comment:3 Changed 7 years ago by Peter Suter

In 15955:

WikiAutoCompletePlugin: Complete wiki: and source: links with digits, minus etc.
(see #12938)

comment:4 Changed 7 years ago by Peter Suter

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Peter Suter.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.