diff --git a/phpdotnet/phd/Format.php b/phpdotnet/phd/Format.php index f59e6a02..e4e5c7fd 100644 --- a/phpdotnet/phd/Format.php +++ b/phpdotnet/phd/Format.php @@ -270,12 +270,15 @@ public function getExamples() { return $this->examples; } public function getRefnameLink($ref) { + $ref = trim($ref); return isset($this->refs[$ref]) ? $this->refs[$ref] : null; } public function getClassnameLink($class) { + $class = trim($class); return isset($this->classes[$class]) ? $this->classes[$class] : null; } public function getVarnameLink($var) { + $var = trim($var); return isset($this->vars[$var]) ? $this->vars[$var] : null; } public function getGeneratedExampleID($index) { diff --git a/tests/render/bug_GH-80.phpt b/tests/render/bug_GH-80.phpt new file mode 100644 index 00000000..2dcb53cb --- /dev/null +++ b/tests/render/bug_GH-80.phpt @@ -0,0 +1,104 @@ +--TEST-- +GH-80: Be more lax in function/methodnames tag in regards to whitespace +--FILE-- +setXml_file($xml_file); +$config->setForce_index(true); + +$render = new Render(); + +$indexRepository = new IndexRepository(new \SQLite3(":memory:")); +$indexRepository->init(); +$config->set_indexcache($indexRepository); + +$index = new TestIndex($indexRepository, $config); +$render->attach($index); + +$reader = new Reader; +$reader->open($config->xml_file(), null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE); +$render->execute($reader); + +$render->detach($index); + +$format = new TestPHPChunkedXHTML($config); +$render = new TestRender(new Reader, $config, $format); + +$render->run(); +?> +--EXPECT-- +Filename: test-function.html +Content: +
(No version information available, might only be in Git)
test_function — For testing
+ +(No version information available, might only be in Git)
Example::testMethod — An example method for testing
+ +(No version information available, might only be in Git)
$TEST_VARIABLE — A test variable
+ ++ test_function() should be linked. +
++ Example should be linked. +
++ Example::testMethod() should be linked. +
++ $TEST_VARIABLE should be linked. +
+