When using the AngularJS Module (angularjs), it adds "partials" (AngularJS templates) as script tags with the attribute type="text/ng-template" in the footer.
When using Bootstrap or a sub-theme, the type attribute is unset by bootstrap_process_html_tag() in theme/system/html-tag.vars.php on line 14.
I have tried to override this functionality by implementing the hook_process_html_tag() in my sub-theme template.php. However, since the type attribute is unset, I can not get the data back. I can add the property back by looking at the tag type and id (partials should have an id of 'partials/template.html').
My question is, is there a better way to fix this issue? And can we think of a way to optionally strip out unnecessary attributes? AFAIK, all of the opinionated Single Page Architecture libraries do something like this with tags (AngluarJS, EmberJS, etc) and thus keeping track of these special cases may wind up being impossible on your end.
Any discussion on best practices for this or guidance on a better solution is greatly appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2201779-6-bootstrap-is-removing-script-type-ld-json-attribute-from-schema-metatags.patch | 2.37 KB | dejan0 |
Comments
Comment #1
markhalliwellCommitted f2fc05b to 7.x-3.x:
Comment #2
markhalliwellComment #5
markhalliwellI'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.
Comment #6
dejan0 commentedIf any other poor people using bootstrap 7.x-3.0, and having an issue with stripping `type="application/ld+json"` attribute from schema_metatag or any other module, here is @markcarver solution in patch form :)Comment #7
dejan0 commentedComment #8
dejan0 commentedIf any other poor people using bootstrap 7.x-3.0, and having an issue with stripping `type="application/ld+json"` attribute from schema_metatag or any other module, here is @markcarver solution in patch form :)
Comment #9
markhalliwellIf you're using bootstrap 7.x-3.0, you really should upgrade to the latest version... that release is over 7 years old!