开发者

Special HTML characters in phpDocumentor in the NetBeans IDE

开发者 https://www.devze.com 2022-12-20 02:17 出处:网络
As you know the NetBeans IDE will pop you inline documentat开发者_如何学JAVAion in your PHP sources based on the phpDocumentor syntax.

As you know the NetBeans IDE will pop you inline documentat开发者_如何学JAVAion 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?


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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消