Page MenuHomePhabricator

datatype URL / query parameter link=none does not work as well as plain printouts #- (1.8 alpha)
Closed, ResolvedPublic


The query parameter link=none does not have any effect for properties of datatype URL. The result is still shown as a link. Likewise it is not possible to create a plain printout with #-

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:52 AM
bzimport set Reference to bz39392.
bzimport added a subscriber: Unknown Object (MLST).

I have to re-open this, since there is a more fundamental issue here that needs to be discussed. The solution I implemented causes other problems (reported in Bug 41275): it is now impossible to make a URL value into a link even if one wants to. As it is now, we do not know of any way to return a URL value that is not linked by MediaWiki automatically but that is linked if you put it in [ ] (e.g. in a template). So we can only have either of these behaviours.

I suggest to have the following:

  • Output format #- returns the plain URL string, as it did originally. This will be turned into a link by MW.
  • A new output format #nowiki returns an escaped URL string that is not turned into a link by MW (and cannot be turned into one with [ ] either).

The question is: what should link=none do? Normally, it means that the output is not linked *actively* by SMW (adding [ ] explicitly). So link=none does mean the same as #- (leaving something away, returning the data in a less processed state). But it is not intuitive that link=none does produce a link in the final output (not in HTML, just on the page). Any comments?

Btw. note that #nowiki could also be supported for string data: there it would escape the string like for datatype Code, so that it is not acted on by MW at all. It seems a fairly useful keyword to have as an output format, since it is already a known term in MW.

  • Bug 41275 has been marked as a duplicate of this bug. ***

+ for your suggestions

Concerning link=none we could adjust the documentation in a way stating it refers to internal links only, which is both the current and future behaviour. Adding an alias link=nointernal would perhaps be a kind of overdoing it.

Supporting #nowiki for datatype string would be nice, too.

This should do it when merged:

This restores the old behaviour on all cases but adds a new #nowiki outputformat to avoid linking the hard way.

Changed the behaviour to be as follows:

  • if linking is enabled ("link=all", default), URLs will be made into an explicit link using [ ] in wiki and <a> in HTML
  • if linking is disabled or outputformat "empty" is used (#- or simply #), then URLs will be returned as plain strings in wiki and HTML; in wiki this will mean that the URL will still be linked if MW is configured to link such strings automatically (default)
  • if the new outputformat "nowiki" is used (#nowiki), then the URL string will be escaped to prevent MW from making a link of it, so it appears as a plain string in HTML and wiki alike; this changes the string so that it is no longer a valid URL