0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| <?php --- xhtml2wiki.php.plus 2010-08-03 00:22:44.000000000 +0900
+++ xhtml2wiki.php.new 2010-08-03 00:23:50.000000000 +0900
@@ -187,7 +187,7 @@
if ($matches[1]) {
$head = str_repeat("+", $this->GetLevel());
}
- if (!$matches[1] && !$matches[3]) {
+ if (!$matches[1] && isset($matches[3]) && !$matches[3]) {
$this->Paragraph($line);
}
else if ($head || $matches[2]) {
@@ -212,7 +212,7 @@
if ($matches[1]) {
$head = str_repeat("-", $this->GetLevel());
}
- if (!$matches[1] && !$matches[3]) {
+ if (!$matches[1] && isset($matches[3]) && !$matches[3]) {
$this->Paragraph($line);
}
else if ($head || $matches[2]) {
@@ -513,7 +513,7 @@
$line = preg_replace("/^\s+/m", '', $line);
}
-
+ $line = $this->DecodeSpecialChars($line);
return $line;
}
@@ -668,8 +668,8 @@
// 特殊な HTML エンティティを文字に戻す
function DecodeSpecialChars($line) {
- static $pattern = array("/&/", "/</", "/>/", "/"/", "/ /");
- static $replace = array('&', '<', '>', '"', ' ');
+ static $pattern = array("/&/", "/</", "/>/", "/"/", "/ /","/[/","/]/");
+ static $replace = array('&', '<', '>', '"', ' ','[',']');
return preg_replace($pattern, $replace, $line);
} ?>
|