예제 #1
0
 /**
  * Truncate a portion of wikitext so that ..
  * ... it is not larger that $lim characters
  * ... it is balanced in terms of braces, brackets and tags
  * ... can be used as content of a wikitable field without spoiling the whole surrounding wikitext structure
  * @param  $lim     limit of character count for the result
  * @param  $text    the wikitext to be truncated
  * @return the truncated text; note that in some cases it may be slightly longer than the given limit
  *         if the text is alread shorter than the limit or if the limit is negative, the text
  *         will be returned without any checks for balance of tags
  */
 function cutAt($lim, $text)
 {
     if ($lim < 0) {
         return $text;
     }
     return DPLInclude::limitTranscludedText($text, $lim);
 }
예제 #2
0
 public static function dplChapterParserFunction(&$parser, $text = '', $heading = ' ', $maxLength = -1, $page = '?page?', $link = 'default', $trim = false)
 {
     $output = DPLInclude::extractHeadingFromText($parser, $page, '?title?', $text, $heading, '', $sectionHeading, true, $maxLength, $link, $trim);
     return $output[0];
 }