";
+}
+
+bool MediaWikiSectionsParser::addListLevel( QString const & levelString )
+{
+ bool convertedToInt;
+ int const level = levelString.toInt( &convertedToInt );
+
+ if( !convertedToInt )
+ {
+ gdWarning( "MediaWiki: sections level is not an integer: %s", levelString.toUtf8().constData() );
+ return false;
+ }
+ if( level <= 0 )
+ {
+ gdWarning( "MediaWiki: unsupported nonpositive sections level: %s", levelString.toUtf8().constData() );
+ return false;
+ }
+ if( level > previousLevel + 1 )
+ {
+ gdWarning( "MediaWiki: unsupported sections level increase by more than one: from %d to %s",
+ previousLevel, levelString.toUtf8().constData() );
+ return false;
+ }
+
+ if( level == previousLevel + 1 )
+ {
+ // Don't close the previous list item tag to nest the current deeper level's list in it.
+ tableOfContents += "\n