function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HarmpieHarmpie 

Warning: The element type "br" should be terminated by the matching end-tag "

WARNING Warning: The element type "br" should be terminated by the matching end-tag "
". at line 30

 

 

This message occasionally occurs as a warning on my VF pages (containing a <apex:pageMessages  /> tag). I have no idea where this warning is coming from...anyone knows (how to get rid of it)?

Best Answer chosen by Admin (Salesforce Developers) 
jwetzlerjwetzler

We supply warnings when your page does not have proper xhtml syntax.  It's generally a good idea to clean up all of your warnings whenever you create a page or component because, just like html, not doing so can potentially have side effects.  Your pages might work, or appear to work, but it's always safer to close every single tag, even though generally speaking in html many people don't close br or p tags.

 

So you should take a swing through your pages and components and make sure they don't have any warnings.  Go to the edit page, make a change (just stick a space in or something) and then hit quick save (not save).  If you're seeing this intermittently it's because the compiler does not always get executed.  Check your page first, and then check any pages or components that are included on your page. 

All Answers

jwetzlerjwetzler

We supply warnings when your page does not have proper xhtml syntax.  It's generally a good idea to clean up all of your warnings whenever you create a page or component because, just like html, not doing so can potentially have side effects.  Your pages might work, or appear to work, but it's always safer to close every single tag, even though generally speaking in html many people don't close br or p tags.

 

So you should take a swing through your pages and components and make sure they don't have any warnings.  Go to the edit page, make a change (just stick a space in or something) and then hit quick save (not save).  If you're seeing this intermittently it's because the compiler does not always get executed.  Check your page first, and then check any pages or components that are included on your page. 

This was selected as the best answer
HarmpieHarmpie

Thanks for the response. I did know about the well-formedness, but seems I overlooked a few nodes. Double checked my code again and it turns out that the problem was in a few self-containing tags, which did not include the space before the "/>". E.g. <apex:outputText value="{!td.dealEndDateString}"/>

 

After changing this to <apex:outputText value="{!td.dealEndDateString}" />, the warning seemed to disappear.

 

This does bring up another few things:

- The warning message is unclear, to say the least.

- Line number(s) do not refer to anything obvious

- The triggering tag name is not correct (no <br />'s in my entire code).

 

Could you explain me a bit on how to interpret the warnings when debugging?

Parikhit SarkarParikhit Sarkar
<br/> ......this should work !