Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If nothing is being inserted into the page by AJAX or anything else, then this is probably due to badly formed html. If there is anything in the source outside of <code>&lt;head&gt;</code>, <code>&lt;body&gt;</code> or <code>&lt;html&gt;</code>, Gokogiri wraps the outlying markup in a separate <code>&lt;html&gt;</code> tag. Then since there are two opening and closing <code>&lt;html&gt;</code> tags, html.ts will be run twice. The solution is to catch the incoming page before we tell Gokogiri what to do with it, and fix the broken html by making sure everything is wrapped in the <code>&lt;body&gt;</code> tag.</p> <p>In scripts/main.ts in your project folder, after </p> <pre><code>match($content_type) { with(/html/) { </code></pre> <p>add this, which removes the <code>&lt;/body&gt;</code> and <code>&lt;/html&gt;</code> tags and appends them to the end:</p> <pre><code> # wrap markup that is outside the body so tritium doesn't get applied twice replace(/\&lt;\/body\&gt;/,"") replace(/\&lt;\/html\&gt;/,"") append("&lt;/body&gt; &lt;/html&gt;") </code></pre> <p>That should ensure there is only one opening an closing <code>&lt;html&gt;</code> tag that gets passed to Gokogiri and that html.ts is only run once as we want it to!</p> <p>The reason the source probably looks okay in Chrome because when the Tritium code is manipulating the page, it moves stuff from both <code>&lt;html&gt;</code> tags into the first one, and when Chrome receives the page, it will wipe the second, empty <code>&lt;html&gt;</code> tag.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload