Last modified: 2006-08-29 11:51:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9090, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7090 - Parse wikilinks with multiline display text
Parse wikilinks with multiline display text
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Template...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-21 23:32 UTC by Jed Clear
Modified: 2006-08-29 11:51 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jed Clear 2006-08-21 23:32:56 UTC
I inadvertently pasted a multi line title parameter into {{tl|cite web}} which
caused the external link to not render correctly.  A bit of discussion on
http://en.wikipedia.org/wiki/Template_talk:Cite_web led to the discovery of the
problem being exhibited by external links in general, rather than that template.  

To recreate, enter an external link with a multiline text portion.  e.g:
  
  [http://www.example.com link to
  example dot com]

It will render the url as a bare target link followed by the text (not linked)
and both surrounded by the single square braces.  Another way to look at it is
that the multiline made external link square braces non special.  The result is
functional, but ugly.

Example of problem is also on cited Template talk page.

Mediawiki version: 1.8alpha (r16137)
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-22 03:11:05 UTC
This is currently intended behavior, not a bug.  Links are HTML <a> elements,
and so can contain HTML line breaks (<br>s), but not <p>s.  MediaWiki generally
ignores a lone line break, and converts any two consecutive line breaks into a
<p>.  Having a lone line break in an external link's display text would
therefore do nothing, and having more would create illegal <p>s.  The same
applies to internal links.

Of course, the rules could always be changed for links if desired, making any
line break into an HTML <br> and suppressing normal linebreak rendering (the
same could be done for literal <h#> and <p> tags).  Is that what you want?  It
seems unlikely to break anything.
Comment 2 Ligulem 2006-08-22 09:06:30 UTC
(In reply to comment #1)
> This is currently intended behavior, not a bug.  Links are HTML <a> elements,
> and so can contain HTML line breaks (<br>s), but not <p>s.  ...

As I understand it, the request by Jed is not to produce a line break in the
html output. He wants the parser to ignore the line break found in the wiki
source in this case. This would allow for more editorial freeness on the level
of the wiki source and maybe help editors making less buggy wiki pages, because
it is a difficult to track down error (an error in the wiki-source for the
respective page). Whitespace is ignored by the parser in other circumstances
too, so it might well be perceieved as odd by editors to have a line break as a
semantic effect, which it is at the moment.
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-22 16:39:06 UTC
In general, fewer linebreaks should be ignored, IMO, not more.  Ignoring
linebreaks is confusing.
Comment 4 Ligulem 2006-08-22 17:03:27 UTC
(In reply to comment #3)
The parser already ignores linebreaks for example inside template call {{..}}.
Example for a valid template call:

{{
   cite web
     | title = No nonsence
     | url = http://example.com
     | accessdate = 2006-08-22
}}

Ignoring whitespace is also done for ParserFunctions ("#if:" & Co). Where it is
helpful for readable wiki-code.

So, for people accustomed to that, significant newlines inside [[ ]] -- which is
only significant in so far as it leads to stupid output -- is more confusing.
Comment 5 Jed Clear 2006-08-24 02:32:43 UTC
Comment #1 is confusing, perhaps I didn't explain clearly.  We are talking about
a single line break, although that shouldn't be relevant as the line break isn't
in the URL, but rather in the text. 

<pre>
The problem is the output of 

[http://www.example.com link to
example dot com]

is not 

<a HREF="http://www.example.com">link to
example dot com</a>

but rather it comes out

[<a href="http://www.example.com">http://www.example.com</a>link to example dot com]

Note the square braces and URL are still visible to the reader, which they
should not be when text is supplied after a URL in single brace wiki text.  

Compare this cite web to comment #4 for another example
{{
cite web
| title = No 
nonsence
| url = http://example.com
| accessdate = 2006-08-22
}}
</pre>



Comment 6 Brion Vibber 2006-08-29 11:33:19 UTC
Wiki markup is line-based, and [url text] is not a multiline construct, but an inline one.
Comment 7 Ligulem 2006-08-29 11:51:13 UTC
Inefficient workarounds for some cases are
http://en.wikipedia.org/wiki/Template:Link,
http://en.wikipedia.org/wiki/Template:Wikilink, which do make the parser happy
by feeding everything on the same line.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links