Skip to content

Commit 59ba8e5

Browse files
committed
Better markdown support for parameters
1 parent 7c7538c commit 59ba8e5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/PHPFUI/InstaDoc/MarkDownParser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public function fileText(string $filename) : string
2121
return $this->text($markdown);
2222
}
2323

24+
public function html(string $markdown) : string
25+
{
26+
return $this->parser->parseParagraph($markdown);
27+
}
28+
2429
public function text(string $markdown) : string
2530
{
2631
$position = 0;

src/PHPFUI/InstaDoc/Section/CodeCommon.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getMethodParameters($method, array $parameterComments = []) : st
6666
if (isset($parameterComments[$name]))
6767
{
6868
$tip = new \PHPFUI\ToolTip($tip, $parameterComments[$name]);
69+
$tip->addAttribute('data-allow-html', true);
6970
}
7071
$info .= $this->getColor('variable', $tip);
7172

@@ -235,7 +236,6 @@ protected function formatComments(?\phpDocumentor\Reflection\DocBlock $docBlock,
235236
$type = '';
236237
}
237238

238-
239239
if ('var' == $name || 'param' == $name)
240240
{
241241
// useless if no description or type
@@ -279,7 +279,7 @@ protected function formatComments(?\phpDocumentor\Reflection\DocBlock $docBlock,
279279
$body .= $this->getColor('variable', '$' . $varname) . ' ';
280280
}
281281
}
282-
$body .= $description;
282+
$body .= $this->parsedown->html($description);
283283
$ul->addItem(new \PHPFUI\ListItem($this->getColor('name', $name) . ' ' . $this->getColor('description', $body)));
284284
}
285285

@@ -523,7 +523,7 @@ protected function getParameterComments(?\phpDocumentor\Reflection\DocBlock $doc
523523
if ('param' == $name && $description)
524524
{
525525
$var = $tag->getVariableName();
526-
$comments[$var] = $description;
526+
$comments[$var] = $this->parsedown->html($description);
527527
}
528528
}
529529

0 commit comments

Comments
 (0)