Stop Stripping HTML Comments from Visualforce Pages - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
450  Points
Idea has been posted. Give it an upvote or downvote.

Stop Stripping HTML Comments from Visualforce Pages

Development (Apex, LWC & VF)

If you add an HTML comment to a visualforce page, this will be removed when the page is rendered.  In cases where the comments are actually controlling how the page behaves (e.g. CSS conditional comments or knockout.js containerless foreach) the comment has to be built up from a number of elements including the dreaded apex:outputText with the escape attribute set to false.  E.g. rather than writing:

<!-- ko foreach: daysOfWeek -->

I have to write:

<apex:outputText value="<" escape="false"/>!-- ko foreach: daysOfWeek --<apex:outputText value=">" escape="false"/> It would be nice to either have comments retained or to have an apex component that generates a comment.

Merge Idea · Flag

  • Upvotes
  • Downvotes



from AppExchange


No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.