I don't think this is possible yet but is NEEDED! How can we develop HTML5 sites with all these unnecessary tags lingering around?
The only way around this is to close the span as soon as you open the component and then reopen it right before close, like this:
<apex:component >
</span> <!-- necessary for clean markup - awaiting salesforce to fix this! -->
<h2>CONTENT HERE</h2>
<span> <!-- necessary for clean markup - awaiting salesforce to fix this! -->
</apex:component>
Of course with the new API versions you can't even do that as the editor will complain that you have an unclosed component tag!!! So you need to change the version of the component to 15 or something like that.
I hope this helps and I hope the mods take note and relay this to the development team.
I don't think this is possible yet but is NEEDED! How can we develop HTML5 sites with all these unnecessary tags lingering around?
The only way around this is to close the span as soon as you open the component and then reopen it right before close, like this:
<apex:component >
</span> <!-- necessary for clean markup - awaiting salesforce to fix this! -->
<h2>CONTENT HERE</h2>
<span> <!-- necessary for clean markup - awaiting salesforce to fix this! -->
</apex:component>
Of course with the new API versions you can't even do that as the editor will complain that you have an unclosed component tag!!! So you need to change the version of the component to 15 or something like that.
I hope this helps and I hope the mods take note and relay this to the development team.
I don't think this is possible yet but is NEEDED! How can we develop HTML5 sites with all these unnecessary tags lingering around?
The only way around this is to close the span as soon as you open the component and then reopen it right before close, like this:
Of course with the new API versions you can't even do that as the editor will complain that you have an unclosed component tag!!! So you need to change the version of the component to 15 or something like that.
I hope this helps and I hope the mods take note and relay this to the development team.
Alex Sartogo
Configero
All Answers
You can use <apex:outputText> so that your code would not render as span for e.g.
where you use
It render as span.You can use
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I need a re-usable component, not outputText or outputPanel. Thanks for your reply anyway.
I don't think this is possible yet but is NEEDED! How can we develop HTML5 sites with all these unnecessary tags lingering around?
The only way around this is to close the span as soon as you open the component and then reopen it right before close, like this:
Of course with the new API versions you can't even do that as the editor will complain that you have an unclosed component tag!!! So you need to change the version of the component to 15 or something like that.
I hope this helps and I hope the mods take note and relay this to the development team.
Alex Sartogo
Configero
I would think that this would break rerendering the component from the page it's used in, wouldn't it?
Nope. Works great as the tags end up being properly closed.
You can use
<apex:outputText escape="false" value="<span>" />
to avoid having to reset your API version number. The outputText doesn't know it's rendering HTML! :-)
<apex:component layout="none">
... your component stuff ...
</apex:component>