JSON-in-HTML Syntax Support
This VSCode extension provides syntax highlighting support for JSON inside HTML.
First, it extends this great extension, and supports two additional script types:
<script></script> tags using
type=application/json or
type=application/ld+json or
type=json or
type=importmap attributes.
will provide JSON editing capabilities inside the script tags.
In addition, json-in-html supports editing json within html tag attributes.
This is helpful for web components, which often make heavy use of JSON-serialized attributes.
Examples
<script type="application/json">
/* JSON HERE */
</script>
<script type="application/ld+json">
/* JSON HERE */
</script>
<script type="importmap">
/* JSON HERE */
</script>
<script type="json">
/* JSON HERE */
</script>
<script type='application/json'>
/* JSON HERE */
</script>
<script type='application/ld+json'>
/* JSON HERE */
</script>
<script type='importmap'>
/* JSON HERE */
</script>
<script type=json>
/* JSON HERE */
</script>
<script type=application/json>
/* JSON HERE */
</script>
<script type=application/ld+json>
/* JSON HERE */
</script>
<script type=importmap>
/* JSON HERE */
</script>
<script type=json>
/* JSON HERE */
</script>
<div attr='
{"x": "hello"}
'></div>
| |