Compare commits

...
8 Commits
Author SHA1 Message Date
Mike van Riel 8f8cbd9ab6 Merge pull request #3 from rvanvelzen/master
Fix phpDocumentor/phpDocumentor2#467
2012-06-04 13:34:54 -07:00
Richard van Velzen a5b50ba482 Fixed the case where the dot does not properly terminate the short description.
The regular expression only took into account newlines, not general whitespace after the dot. Added a test case as well.
2012-06-04 09:27:56 +02:00
Mike van Riel f0a2901e56 Updated README to reflect submission to packagist 2012-06-02 22:07:17 +02:00
Mike van Riel bc982b7d51 Merge pull request #2 from egeniq/master
Small path fix
2012-06-02 13:00:11 -07:00
= b892415ca3 Fix for relative paths 2012-06-02 21:44:44 +02:00
Mike van Riel 37a1ac2e19 Merge branch 'master' of github.com:phpDocumentor/ReflectionDocBlock 2012-05-26 10:29:51 +02:00
Mike van Riel 0b096ce2e7 Merge pull request #1 from leofeyer/master
Broken markdown support for long descriptions
2012-05-14 23:26:52 -07:00
Leo Feyer 5aea3269e1 This will bring back the markdown parser to long descriptions 2012-05-14 17:35:02 +02:00
5 changed files with 25 additions and 7 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ Installation
You can install the component in the following ways: You can install the component in the following ways:
* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock) * Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock)
* Via composer (add the Github Repository as VCS repository in your composer.yml) * Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock)
Usage Usage
----- -----
+4 -4
View File
@@ -127,11 +127,11 @@ class DocBlock implements \Reflector
preg_match( preg_match(
'/(?x) '/(?x)
\A ( \A (
[^\n]+ [^\n.]+
(?: (?:
(?! (?<=\.) \n | \n{2} ) # disallow the first seperator here (?! \. \s | \n{2} ) # disallow the first seperator here
\n (?! [ \t]* @\pL ) # disallow second seperator [\n.] (?! [ \t]* @\pL ) # disallow second seperator
[^\n]+ [^\n.]+
)* )*
\.? \.?
) )
@@ -78,7 +78,7 @@ class LongDescription implements \Reflector
); );
} }
if (class_exists('\dflydev\markdown\MarkdownExtraParser()')) { if (class_exists('\dflydev\markdown\MarkdownExtraParser')) {
$md = new \dflydev\markdown\MarkdownExtraParser(); $md = new \dflydev\markdown\MarkdownExtraParser();
$result = $md->transformMarkdown($result); $result = $md->transformMarkdown($result);
} }
@@ -59,7 +59,7 @@ class Tag implements \Reflector
$tag_name = str_replace( $tag_name = str_replace(
' ', '', ucwords(str_replace('-', ' ', $matches[1])) ' ', '', ucwords(str_replace('-', ' ', $matches[1]))
).'Tag'; ).'Tag';
$class_name = '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name; $class_name = 'phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name;
return (@class_exists($class_name)) return (@class_exists($class_name))
? new $class_name($matches[1], isset($matches[2]) ? $matches[2] : '') ? new $class_name($matches[1], isset($matches[2]) ? $matches[2] : '')
@@ -44,4 +44,22 @@ DOCBLOCK;
$this->assertTrue($object->hasTag('see')); $this->assertTrue($object->hasTag('see'));
$this->assertTrue($object->hasTag('return')); $this->assertTrue($object->hasTag('return'));
} }
public function testDotSeperation()
{
$fixture = <<<DOCBLOCK
/**
* This is a short description. This is a long description.
* This is a continuation of the long description.
*/
DOCBLOCK;
$object = new DocBlock($fixture);
$this->assertEquals(
'This is a short description.', $object->getShortDescription()
);
$this->assertEquals(
"This is a long description.\nThis is a continuation of the long description.", $object->getLongDescription()->getContents()
);
} }
}