views:

202

answers:

3

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?

A: 

I would have thought surely phpDocumentor are right by definition? It's their format after all.

It does seem pretty undesirable to be doing an HTML-decode at this stage; the whole idea of text-markup systems like this is to avoid HTML details like entity reference escaping. What happens to any literal HTML you put in, does NetBeans try to render it?

bobince
If I use something like <strong>foo</strong> I see "foo" in bold in the NetBeans IDE.
AlexV
Oh dear! That doesn't seem like a good feature to me. What about `<script>alert('grrrrr!')</script>`? :-)
bobince
For this I get " abr />"... Quite stange!
AlexV
[scratches head]
bobince
A: 

Well the right way to do anything, in regards to handling special characters, is to use the actual characters you want and convert them at the moment you need to.

Therefor the correct way is to use actual < > & characters in your comments and the phpDoc addon needs to convert them to the HTML encoded versions for the .HTML files, if it doesn't do that, then it's them who is wrong, despite what they do or say.

TravisO
A: 

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...

AlexV
This is now fixed in NetBeans 6.9.
Activist
Cool thanks for the update!
AlexV