summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHartmut Holzgraefe <hholzgra@php.net>2003-04-24 18:03:12 +0000
committerHartmut Holzgraefe <hholzgra@php.net>2003-04-24 18:03:12 +0000
commit28f39fba9506881fef4c876064ce3cdc83d923b2 (patch)
treebcbe47b87429b22bf292e094bf4d7aa3125389c8 /scripts
parent580115b589a478ec3e6ce34b4773505d04990e85 (diff)
downloadphp-git-28f39fba9506881fef4c876064ce3cdc83d923b2.tar.gz
<![CDATA[ generates additional linefeeds?
-> trim these ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ext_skel_ng/extension_parser.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/ext_skel_ng/extension_parser.php b/scripts/ext_skel_ng/extension_parser.php
index 65fa624eb0..c9846348e6 100644
--- a/scripts/ext_skel_ng/extension_parser.php
+++ b/scripts/ext_skel_ng/extension_parser.php
@@ -68,7 +68,7 @@
}
function handle_extension_description($attr) {
- $this->description = $this->cdata;
+ $this->description = $this->_trimdata();
}
function handle_extension_logo($attr) {
@@ -168,11 +168,11 @@
// {{{ resources
function handle_resources_resource_destruct($attr) {
- $this->resource_destruct = $this->cdata;
+ $this->resource_destruct = $this->_trimdata();
}
function handle_resources_resource_description($attr) {
- $this->resource_description = $this->cdata;
+ $this->resource_description = $this->_trimdata();
}
function handle_resources_resource($attr) {
@@ -197,20 +197,26 @@
$this->func_summary = trim($this->cdata);
}
+ function _trimdata() {
+ $text = preg_replace('|^\s*\n|m','', $this->cdata);
+ $text = preg_replace('|\n\s*$|m',"\n", $text);
+ return $text;
+ }
+
function handle_functions_function_proto($attr) {
$this->func_proto = trim($this->cdata);
}
function handle_functions_function_description($attr) {
- $this->func_desc = trim($this->cdata);
+ $this->func_desc = $this->_trimdata();
}
function handle_functions_function_code($attr) {
- $this->func_code = $this->cdata;
+ $this->func_code = $this->_trimdata();
}
function handle_code($attr) {
- $this->code[$attr["role"]][] = $this->cdata;
+ $this->code[$attr["role"]][] = $this->_trimdata();
}
function handle_functions_function($attr) {
@@ -306,7 +312,6 @@
function generate_documentation() {
$id_name = str_replace('_', '-', $this->name);
- system("rm -rf {$this->name}/manual");
mkdir("{$this->name}/manual");
$docdir = "{$this->name}/manual/$id_name";