phpDocumentor / phpDocumentor/phpDocumentor

Seeing unexpected/possibly faulty HTML class tags in the output

Open
#3,745 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
4.3k
Forks
648
Avg merge
28m
Merged PRs (30d)
13

Description

Expected behavior

  1. No class tags when there are no classes for a certain HTML element
  2. No class names starting with a -.

Actual behavior

The diffs are compared to phpDocumenter 3.4.3

  1. No class tags when there are no classes for a certain HTML element
-    <a href="classes/WpOrg-Requests-Auth.html#method_register">register()</a>
+    <a class="" href="classes/WpOrg-Requests-Auth.html#method_register">register()</a>

The class="" is redundant.

  1. No class names starting with a -.
-                    <section class="phpdocumentor-sidebar__category">
+                    <section class="phpdocumentor-sidebar__category -namespaces">

I'd expect the class name either to be phpdocumentor-sidebar__category-namespaces - i.e. without the space before the - - or this to be two class names and the second class name to not start with a -.

While the above may be intentional, to a casual onlooker, like me, it looks like an error.

Steps to reproduce the problem

The issue can be seen in this PR: https://github.com/WordPress/Requests/pull/883 which was created by this build: https://github.com/WordPress/Requests/actions/runs/9835949221 using this workflow: https://github.com/WordPress/Requests/blob/develop/.github/workflows/update-website.yml

Your environment

  • Version used: 3.5.2
  • Install method: PHAR (via setup-php)
  • PHP version: 8.1.29
  • Operating system and version: Ubuntu 22.04.4 (ubuntu-latest on GHA)
  • Link to your project: https://github.com/WordPress/Requests/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the generated output from WordPress/Requests PR 883 using the .github/workflows/update-website.yml workflow, then trace the phpDocumentor 3.5.2 template or rendering path responsible. Done means empty class attributes are omitted and generated class names do not begin with a hyphen, with the output verified against the reported examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.