Repository navigation
Keep paragraphs and code blocks in ApiGen descriptions - #6849
Merged
Merged
Conversation
phpdoc-parser puts each paragraph of a PHPDoc into its own text node. ApiGen dropped the empty nodes between them and joined the rest with a space, so every description rendered as one paragraph. Lists, tables and code fences that did not start the description were not recognized, and short descriptions in namespace listings showed the whole text. Amp-Thread-ID: https://ampcode.com/threads/T-01a176c6-528a-7430-b296-e66930d153b4
ondrejmirtes
force-pushed
the
apigen-paragraphs
branch
from
October 26, 2026 08:11
abfd82f to
ba468a1
Compare
phpdoc-parser trims the first line of a paragraph, so indented code samples lost the indentation that made them code blocks. Amp-Thread-ID: https://ampcode.com/threads/T-01a176c6-528a-7430-b296-e66930d153b4
ondrejmirtes
force-pushed
the
apigen-paragraphs
branch
from
October 26, 2026 08:11
ba468a1 to
cd6acd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every description on apiref.phpstan.org rendered as one long paragraph, for example TrinaryLogic.
PhpDocResolversubclass keeps them as blank lines, andMarkdownConverterremoves the spaces ApiGen's join adds around them. Lists, tables and code fences now render wherever they appear, not only at the start of a description. Namespace listings now show only the first paragraph as the short description, as ApiGen intends.getTemplateType()example, which used a@-templateworkaround), TypeTraverser::map(), VerbosityLevel, GeneralizePrecision, AccessoryType and ContainerExtensionsExtension now use```phpfences.Checked by generating the docs before and after. Both runs produce 1776 files. Descriptions have 7542 → 8381
<p>elements and 13 → 33 links. Raw```text no longer appears outside the source listing pages; before, 160 lines showed it, including existing fenced examples in other PHPDocs that were broken by the join. The<pre>blocks that disappeared were all on namespace index pages, which used to show each class's full description.