svn: /phd/trunk/phpdotnet/phd/Format/Abstract/ Manpage.php
| From: | Hannes Magnusson | Date: | Sun, 25 Apr 2010 10:09:05 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/Format/Abstract/ Manpage.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6444@lists.php.net to get a copy of this message | ||
bjori Sun, 25 Apr 2010 10:09:05 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298489
Log:
- Remove some strncmp()
- Fix CS
Changed paths:
U phd/trunk/phpdotnet/phd/Format/Abstract/Manpage.php
Modified: phd/trunk/phpdotnet/phd/Format/Abstract/Manpage.php
===================================================================
--- phd/trunk/phpdotnet/phd/Format/Abstract/Manpage.php 2010-04-25 09:57:18 UTC (rev 298488)
+++ phd/trunk/phpdotnet/phd/Format/Abstract/Manpage.php 2010-04-25 10:09:05 UTC (rev 298489)
@@ -21,18 +21,26 @@
public function TEXT($str) {
$ret = trim(preg_replace( '/[ \n\t]+/', ' ', $str));
+
// No newline if current line begins with ',', ';', ':',
'.'
- if (strncmp($ret, ",", 1) && strncmp($ret, ";", 1) &&
strncmp($ret, ":", 1) && strncmp($ret, ".", 1))
- $ret = "\n" . $ret;
- return $ret;
+ if (in_array($ret[0], array(",", ";", ":", "."))) {
+ return $ret;
+ }
+
+ return "\n" . $ret;
}
public function transformFromMap($open, $tag, $name, $attrs, $props) {
- if ($tag === '') return $tag;
- $isMacro = (strncmp($tag, ".", 1) == 0);
+ if ($tag === '') {
+ return $tag;
+ }
+
+ $isMacro = $tag[0] == ".";
+
if ($open) {
return "\n" . $tag . ($isMacro ? "\n" : "");
}
+
return ($isMacro ? "" : "\\fP");
}