Page MenuHomePhabricator

Nogomatch shows URL with brackets instead of an actual link
Closed, DeclinedPublic

Description

Author: mark

Description:
Hi. I'm sorry if I'm duplicating another bug, but I only found one other report
and that was for 1.5.x.

I'm running 1.4.9 and trying to allow people to create pages easily by having a
link on search pages. I go to modify Nogomatch and I have tried a few different
syntaxes. I initially tried the one from Wikipedia, and that produced the
following when I search on a page:

No page with that title exists. You can, however
'''create an article with this title.'''

That's not the code, it actually shows that on the search results page when I
search for something like "sdfdsaf". However, when I preview Nogomatch while
editing, it looks like a normal link and how it should be.

I also tried the following code for Nogomatch, and it didn't work either:

You can however
'''[{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} create an
article with this title.]'''

Using that code showed similar to the above but with the full URL as well.


Version: 1.4.x
Severity: normal
OS: FreeBSD
Platform: PC
URL: http://www.mixxnet.net/wiki/index.php?search=asdfsd&go=Go

Details

Reference
bz3326

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:49 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz3326.
bzimport added a subscriber: Unknown Object (MLST).

mark wrote:

Well this was the code I tried initially, just like Wikipedia has:

You can however '''[[<nowiki>$1</nowiki>|create an article with this title]].'''

That didn't work. What do you mean by HTML?

Thanks.

Wikipedia is not running 1.4, it's running a different version which behaves
differently. That's why I told you to do something different for your version.

HTML is the markup language used for formatting web pages. You can search for more
information on HTML in a search engine such as Google.

mark wrote:

Right I know what HTML is, but how does HTML integrate with MediaWiki?

In other words, what would the target for the a href be to say "create (or edit)
the title of the page that was searched for" to allow someone to create a new page?

rowan.collins wrote:

In other words, what would the target for the a href be to say "create (or edit)
the title of the page that was searched for" to allow someone to create a new

page?

If you think about it, you've already answered this yourself:

You can however
'''[{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} create an
article with this title.]'''

Using that code showed similar to the above but with the full URL as well.

So that's where you get the URL from, and the relevance of HTML is that that's
what the message is treated as - raw HTML inserted at the appropriate point in
the page. [Note also that the $1 is magically substituted with something
relevant - it should be easy to discover what by experiment - when the message
is used.]

mark wrote:

Well, "<a
href="{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}}">create an
article with this title</a>" doesn't work so I'm not sure what you mean by using
HTML. Trying that above code outputs the following as text on the search page:

<a
href="http://www.mydomain.net/wiki/index.php?title=MediaWiki:Nogomatch&action=edit">create
an article with this title</a>.

I tried the $1 thing before, and it just shows the text of the link/code instead
of linking to it properly. There must be some sort of bug in the software for
this not to properly work. I don't know what to say, this can't be entirely an
error on my part.

en.ABCD wrote:

How about:

<a href="$1" class="new">create an article with this title</a>....

mark wrote:

(In reply to comment #7)

How about:

<a href="$1" class="new">create an article with this title</a>....

Nope. That just displays that <a href etc...> as text over again like so:

You can, however <a href="$1" class="new">create an article with this title.</a>

robchur wrote:

Works as wiki text in 1.5 upwards. 1.4 is now obsolete.