#

Rich Content

The Rich Content Document Record is included in the defaults in our relay, and lets you mark any element to be stored as sanitized HTML in the triplestore.

v0.7

Here's what this page has sent to OP


BACKLINKS

The default harmonizer reads the inner HTML of the first element marked data-octo-content="rich", data-octo-content="rich-content" or class="octo-content", and stores it in the page’s documentRecord.richContent. Scripts, styles, frames, event handlers and javascript: links are stripped first, and the stored HTML is capped at 100 KB. An element with a bare data-octo-content attribute, or any other value, is ignored; other values are reserved for future content types.

In action on this page

Stored as rich content

This paragraph and its link are kept.

The onclick handler on this paragraph is stripped.

This link keeps its text but loses its javascript: href.

This element has a bare data-octo-content attribute, so it isn't captured.

Raw HTML

<div data-octo-content="rich">
  <h4>Stored as rich content</h4>
  This <em>paragraph</em> and its <a href="https://docs.octothorp.es">link</a> are kept.
  <p onclick="console.log('onclick is stripped')">The onclick handler on this paragraph is stripped.
  <script>console.log('This script runs on the page but is stripped from richContent.')</script>
  <a href="javascript:void(0)">This link keeps its text but loses its javascript: href.</a>
</div>

<div data-octo-content="">
  This element has a bare data-octo-content attribute, so it isn't captured.
</div>