Reputation: 153
I intend to use MediaWiki API to create a table for a wiki page. In MediaWiki, the syntax for creating a table should be like the following:
{|class="wikitable sortable"
!'''Full Name'''||'''Short Name'''
|-
|MediaWiki||MW
|} //line breaks must be made
When I called MediaWiki API, I stored the contents in a string:
$content = "{|class='wikitable sortable'!'''Full Name'''||'''Short Name'''|-|MediaWiki||MW|}";
The string will be used as one parameters when MediaWiki API is called, and it will be as the editing contents for that wiki page. I intended to used "br" or "\n" to make line breaks, but failed to create a table. Without line breaks, a table can't be showed either. How can I make line breaks before I call MediaWiki API?
Upvotes: 1
Views: 127