You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to strip a node for HTML tags ... how would I go about doing that? I've spent a couple of hours trying to 'figure' out the docs and trying all sorts of things by basically guessing, as the docs are clearly written by the same guy who wrote the lib. But I have had absolutely no success in using any of that information.
I have a node that looks like this:
<text>Ya da <grouptext>Ga Ba</grouptext>.</text>
I need to strip the text node for grouptext nodes (leaving out that 'level').
Now, from the docs I'm getting the impression I can add a custom function to the config:
var xmljs_options = {
compact: true,
spaces: 2,
textFn: function ( value, parentElement ) {
// How can I access the text node on the parent element
// and modify the value?
if ( parentElement.nodeName? === 'text') {
// strip tags and return modified value
}
}
};
The text was updated successfully, but these errors were encountered:
I need to strip a node for HTML tags ... how would I go about doing that? I've spent a couple of hours trying to 'figure' out the docs and trying all sorts of things by basically guessing, as the docs are clearly written by the same guy who wrote the lib. But I have had absolutely no success in using any of that information.
I have a node that looks like this:
I need to strip the text node for grouptext nodes (leaving out that 'level').
Now, from the docs I'm getting the impression I can add a custom function to the config:
The text was updated successfully, but these errors were encountered: