Page MenuHomePhabricator

Parser failing to recognise line/paragraph breaks are scoped to within an element/block in template code.
Closed, InvalidPublic

Description

The relevant template: https://en.wikivoyage.org/wiki/Template:Listing/sandbox

The sample markup ( extracted from https://en.wikivoyage.org/w/index.php?title=Bangkok&action=edit&lintid=8725) with the sandbox template being used.

* {{listing/sandbox
| name=Northern and Northeastern Bus Terminal | alt=Mo Chit 2 (หมอชิต 2 | url= | email=
| address= | lat=13.8123 | long=100.5479 | directions=
| phone=+66 2 9362841 (-3) | tollfree= | fax=
| hours= | price=
| content=The largest, busiest, and most modern terminal, replacing the old Mo Chit terminal. The upper floor serves the [[Isaan]] region in the northeast of Thailand. The ground floor serves [[Northern Thailand]], and shares some destinations with Ekkamai (including [[Pattaya]], [[Rayong]], [[Chanthaburi]] and [[Trat]]). The bus terminal is a fair hike from BTS station Mo Chit or MRT station Chatuchak Park. Motorbike taxis do the trip for a fixed 50 baht fare (bargaining is pointless), while tuk-tuks charge whatever they feel like — when bargaining, remember that a real taxi with air conditioning will cost you about 45 baht (assuming little traffic). You can also take '''Bus 77''' and pay the 13 baht flat fare on board (this bus also goes from the terminal via Victory Monument, Pratunam, and Silom Rd). If you have a considerable amount of luggage, the easiest, if not necessarily fastest, option is to take a taxi directly to or from the bus terminal. 

Buying tickets at the terminal is reasonably easy: find a window with your destination written on it (in friendly Roman letters), pay the fare in big numbers on the same window, and you'll get a ticket on the next available departure. Note that blue writing means 1st class, red means 2nd class (avoid on longer trips), and tickets for destinations in Isaan are sold from the third floor. Ask the information desk on the first floor if you need help, or any of the Transport Co. staff, easily identifiable thanks to their natty white shirts with gold buttons. Next just find the departure stall and you're on your way. If you have time to kill, there are two fairly decent air-conditioned food courts at both ends of the main terminal building, plus KFC, Dunkin' Donuts, and lots of 7-Eleven outlets.

Since Feb 2013 air conditioned buses are available directly from Bangkok Mo Chit to Siem Reap, Cambodia. [http://home.transport.co.th/index.php/en/ Transport Co.], the state-owned company running the buses, offers daily services to Siem Reap for 750 baht. Departures every day at 08:00 and 09:00 in both directions. 
}}

The RAW HTML generated...

<ul><li> <div class="vcard"><span><span class="noprint listing-coordinates" style="display:none"><span class="geo"><abbr class="latitude">13.8123</abbr><abbr class="longitude">100.5479</abbr></span></span><span title="Map for this &#39;listing&#39; marker"><a class="mw-kartographer-maplink mw-kartographer-autostyled" mw-data="interface" data-style="osm-intl" href="/wiki/Special:Map/17/13.8123/100.5479" data-zoom="17" data-lat="13.8123" data-lon="100.5479" style="background: #228B22;" data-overlays="[&quot;mask&quot;,&quot;around&quot;,&quot;buy&quot;,&quot;city&quot;,&quot;do&quot;,&quot;drink&quot;,&quot;eat&quot;,&quot;go&quot;,&quot;listing&quot;,&quot;other&quot;,&quot;see&quot;,&quot;sleep&quot;,&quot;vicinity&quot;,&quot;view&quot;,&quot;black&quot;,&quot;blue&quot;,&quot;brown&quot;,&quot;chocolate&quot;,&quot;forestgreen&quot;,&quot;gold&quot;,&quot;gray&quot;,&quot;grey&quot;,&quot;lime&quot;,&quot;magenta&quot;,&quot;maroon&quot;,&quot;mediumaquamarine&quot;,&quot;navy&quot;,&quot;red&quot;,&quot;royalblue&quot;,&quot;silver&quot;,&quot;steelblue&quot;,&quot;teal&quot;,&quot;fuchsia&quot;]">1</a>&#32;</span><span id="Northern_and_Northeastern_Bus_Terminal" class="fn org listing-name"><b>Northern and Northeastern Bus Terminal</b></span></span>&#32;(<span class="nickname listing-alt">Mo Chit 2 (หมอชิต 2</span>),&#160;<abbr title="phone">☎</abbr> <span class="tel listing-phone"><span class="plainlinks nourlexpansion"><a rel="nofollow" class="external text" href="tel:+6629362841">+66 2 9362841</a></span> (-3)</span>.<div class="note listing-content">The largest, busiest, and most modern terminal, replacing the old Mo Chit terminal. The upper floor serves the <a href="/wiki/Isaan" title="Isaan">Isaan</a> region in the northeast of Thailand. The ground floor serves <a href="/wiki/Northern_Thailand" title="Northern Thailand">Northern Thailand</a>, and shares some destinations with Ekkamai (including <a href="/wiki/Pattaya" title="Pattaya">Pattaya</a>, <a href="/wiki/Rayong" title="Rayong">Rayong</a>, <a href="/wiki/Chanthaburi" title="Chanthaburi">Chanthaburi</a> and <a href="/wiki/Trat" title="Trat">Trat</a>). The bus terminal is a fair hike from BTS station Mo Chit or MRT station Chatuchak Park. Motorbike taxis do the trip for a fixed 50 baht fare (bargaining is pointless), while tuk-tuks charge whatever they feel like — when bargaining, remember that a real taxi with air conditioning will cost you about 45 baht (assuming little traffic). You can also take <b>Bus 77</b> and pay the 13 baht flat fare on board (this bus also goes from the terminal via Victory Monument, Pratunam, and Silom Rd). If you have a considerable amount of luggage, the easiest, if not necessarily fastest, option is to take a taxi directly to or from the bus terminal. </li></ul>
<p>Buying tickets at the terminal is reasonably easy: find a window with your destination written on it (in friendly Roman letters), pay the fare in big numbers on the same window, and you'll get a ticket on the next available departure. Note that blue writing means 1st class, red means 2nd class (avoid on longer trips), and tickets for destinations in Isaan are sold from the third floor. Ask the information desk on the first floor if you need help, or any of the Transport Co. staff, easily identifiable thanks to their natty white shirts with gold buttons. Next just find the departure stall and you're on your way. If you have time to kill, there are two fairly decent air-conditioned food courts at both ends of the main terminal building, plus KFC, Dunkin' Donuts, and lots of 7-Eleven outlets.
</p>
Since Feb 2013 air conditioned buses are available directly from Bangkok Mo Chit to Siem Reap, Cambodia. <a rel="nofollow" class="external text" href="http://home.transport.co.th/index.php/en/">Transport Co.</a>, the state-owned company running the buses, offers daily services to Siem Reap for 750 baht. Departures every day at 08:00 and 09:00 in both directions.</div><span class="listing-metadata">
</span></div>

What was expected to happen was that the parser recognised that the entire portion of content within the template was part of the list item. The list item/list should have been terminated after the final DIV and not before. Currently the code listed is malformed as the closing DIV's occur in the wrong place structurally.

(Aside: It would be so much simpler, if Mediawiki gave up trying to be too clever and instead had PROPER end of item, end of list, end of paragraph etc. indicators, instead of using a newline, double new-line to mean at least 5 different things.)

Event Timeline

ShakespeareFan00 renamed this task from Parser failing to recognise line breaks are scoped to within an element/block in template code. to Parser failing to recognise line/paragraph breaks are scoped to within an element/block in template code..Apr 23 2017, 10:44 PM
Aklapper added a subscriber: Paladox.

@Paladox: Please do not add MediaWiki-General when better suited projects are available. Thanks.

Closing this as invalid, The issue seems to be to do with how the template was written originally.