Search code examples
phpnetbeansspecial-charactersphpdoc

Special HTML characters in phpDocumentor in the NetBeans IDE


As you know the NetBeans IDE will pop you inline documentation in your PHP sources based on the phpDocumentor syntax.

What I found out is that when I use special HTML characters in my phpDocumentor documentation they are treated as HTML in NetBeans but as text in the HTMl doc generated by phpDocumentor.

For example:

/**
 * Add a new <link> to the <head> of the document.
 */

In the HTML generated by phpDocumentor, will be shown as:

Add a new <link> to the <head> of the document.

But in the NetBeans IDE it will be shown as:

Add a new <link> to the <head> of the document.

Which one is right? What is the correct way to embed special HTML characters in your phpDocumentor comments?


Solution

  • After some reseach it seems that phpDocumentor/NetBeans must interpret some tags. As you can see on Wikipedia here, only the following tags should be interpreted as HTML:

    • b
    • code
    • br
    • i
    • kbd
    • li
    • ol
    • p
    • pre
    • samp
    • ul
    • var

    All others tags should be displayed as plain text. Currently NetBeans interpret all tags. This is a bug IMO since phpDocumentor docBuilder only interpret some tags.

    I opened an issue (180636) on the NetBeans website.

    Hopefully it will be fixed soon...