Formats a text field as encoded JSON. This can be useful in combination with Views Datasource.
Currently it supports:
- text
- text_long
- text_with_summary
What is does:
It formats your field as encoded JSON.
How it works:
It passes the raw value of a field (say a body field with a lot of html markup) through the function "drupal_json_encode".
When to use:
If you want to escape your html fields for using in Views Datasource / Views JSON. That module doesn't handle 'raw' formats very well.
Original HTML
<h2>Header2</h2>
<p>Paragraph with <a href="http://drupal.org">link to drupal.org</a>.</p>
<h3>Header3</h3>
<p>Another paragraph.</p>
<ul>
<li>list item a</li>
<li>list item b</li>
</ul>
Encoded JSON (via drupal_json_encode)
\"\\u003Ch2\\u003EHeader2\\u003C\\/h2\\u003E\\r\\n\\r\\n\\u003Cp\\u003EParagraph with\\u0026nbsp;\\u003Ca href=\\u0022http:\\/\\/drupal.org\\u0022\\u003Elink to drupal.org\\u003C\\/a\\u003E.\\u003C\\/p\\u003E\\r\\n\\r\\n\\u003Ch3\\u003EHeader3\\u003C\\/h3\\u003E\\r\\n\\r\\n\\u003Cp\\u003EAnother paragraph.\\u003C\\/p\\u003E\\r\\n\\r\\n\\u003Cul\\u003E\\r\\n\\t\\u003Cli\\u003Elist item a\\u003C\\/li\\u003E\\r\\n\\t\\u003Cli\\u003Elist item b\\u003C\\/li\\u003E\\r\\n\\u003C\\/ul\\u003E\\r\\n\"
Project information
- Project categories: Site structure
20 sites report using this module
- Created by ndf on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
