Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parser v1.3.1
math 매크로 변경  등
  • Loading branch information
dercsyong committed Apr 15, 2020
1 parent 8ec4b4b commit 4b50b66
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions theMark.php
Expand Up @@ -674,7 +674,7 @@ private function tableParser($text, &$offset) {
case '(': break;
case ':': $td->style['text-align'] = 'center'; break;
case ')': $td->style['text-align'] = 'right'; break;
case 'white': case 'black': case 'gray': case 'red': case 'blue': case 'pink': case 'green': case 'yellow': case 'dimgray': case 'midnightblue': case 'lightskyblue': case 'orange': case 'firebrick': case 'gold': case 'forestgreen': case 'orangered': case 'darkslategray': case 'deepskyblue':
case 'white': case 'black': case 'gray': case 'red': case 'blue': case 'pink': case 'green': case 'yellow': case 'dimgray': case 'midnightblue': case 'lightskyblue': case 'orange': case 'firebrick': case 'gold': case 'forestgreen': case 'orangered': case 'darkslategray': case 'deepskyblue': case 'lavender':
$td->style['background-color'] = $prop;
break;
default:
Expand Down Expand Up @@ -1079,22 +1079,14 @@ private function macroProcessor($text, $type) {
}
elseif(self::startsWithi(strtolower($text), 'view') && preg_match('/^view\((.+)\)$/i', $text, $include) && $include = $include[1]) {
switch($include){
case 'edits':
return getEditCount();
case 'count':
$sql = "SELECT sum(count) AS result FROM wiki_count";
$res = mysqli_query($wiki_db, $sql);
$row = mysqli_fetch_assoc($res);
if(empty($row['result'])){
return ' 0';
}
break;
case 'recent':
$sql = "SELECT count(*) AS result FROM wiki_contents_history";
$res = mysqli_query($wiki_db, $sql);
$row = mysqli_fetch_array($res);
if(empty($row['result'])){
return ' 0';
}
break;
return getViewCount();
case 'actives':
return getActiveUser();
case 'users':
return getAllUser();
default: return ' 0';
}
return number_format($row['result']);
Expand Down Expand Up @@ -1143,7 +1135,7 @@ private function macroProcessor($text, $type) {
}
return 0;
}
elseif(self::startsWithi(strtolower($text), 'math') && preg_match('/^math\((.+)\)$/i', $text, $include) && $include = $include[1]) {
elseif(self::startsWithi(strtolower($text), 'definedmath') && preg_match('/^definedmath\((.+)\)$/i', $text, $include) && $include = $include[1]) {
$include = explode(',', $include);

$pattern = '/(\+|-|\/|\*|\+-)+/';
Expand Down Expand Up @@ -1234,6 +1226,9 @@ private function macroProcessor($text, $type) {

return 0;
}
elseif(self::startsWithi(strtolower($text), 'math') && preg_match('/^math\((.+)\)$/i', $text, $include) && $include = $include[1]) {
return '<math>'.$include.'</math>';
}
elseif(self::startsWith($text, '*') && preg_match('/^\*([^ ]*)([ ].+)?$/', $text, $note)) {
$notetext = !empty($note[2])?$this->formatParser($note[2]):'';
$id = $this->fnInsert($this->fn, $notetext, $note[1]);
Expand Down

0 comments on commit 4b50b66

Please sign in to comment.