Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamically group poorly-structured HTML, that has no IDs?
    primarykey
    data
    text
    <p>There is a very old website I use and the data is not displayed in a friendly fashion. I would like to write a userscript (javascript/jQuery) that assists the readability of this site. The content looks like (the HTML comments are my own, to help show this):</p> <pre><code>&lt;font size="3" face="Courier"&gt; &lt;br&gt; &lt;!-- Begin entry 1 --&gt; Name1 (Location1) - Date1: &lt;br&gt; Text1 &lt;br&gt; Text1 (continued) &lt;br&gt; Text1 (continued) &lt;br&gt; &lt;br&gt; &lt;!-- Begin entry 2 --&gt; Name2 (Location2) - Date2: &lt;br&gt; Text2 &lt;br&gt; Text2 (continued) &lt;br&gt; &lt;br&gt; Text2 (continued) &lt;br&gt; Text2 (continued) &lt;br&gt; &lt;br&gt; &lt;!-- Begin entry 3 --&gt; Name3 (Location3) - Date3: &lt;br&gt; Text3 &lt;br&gt; Text3 (continued) &lt;br&gt; Text3 (continued) &lt;br&gt; &lt;br&gt; &lt;br&gt; Text3 (continued) &lt;br&gt; Text3 (continued) &lt;!-- Below is Text3, but a user copied Entry1 here --&gt; Name1 (Location1) - Date1: &lt;!-- text3 --&gt; &lt;br&gt; &lt;!-- text3 --&gt; Text1 &lt;!-- text3 --&gt; &lt;br&gt; &lt;!-- text3 --&gt; Text1 (continued) &lt;!-- text3 --&gt; &lt;br&gt; &lt;!-- text3 --&gt; Text1 (continued) &lt;!-- text3 --&gt; &lt;br&gt; &lt;br&gt; &lt;!-- Begin entry 4 --&gt; Name4 ... ...... &lt;/font&gt; </code></pre> <ul> <li>Example of names: <code>Bob Dole</code>, <code>SMITH,JOHN</code></li> <li>Example of locations: <code>via Web</code>, <code>INTERNAL</code></li> <li>Example of dates: <code>Jul 25, 2011 - 1317 EDT</code>, <code>Dec 30, 2011 - 1411 EST</code></li> <li>Example of Text1/Text2/etc: <code>Blah blah * (test) text goes here -Thanks Here: there</code></li> </ul> <p>As you can see, two <code>&lt;br&gt;</code> always come before the next "entry" (name, location, date) but since the text is free text it can also contain various <code>&lt;br&gt;</code> including 2 or more. Another issue is if the text also contains <code>Name (Location) - Date</code> pasted from say another entry elsewhere.</p> <p>So if I wanted to write a script that could be added to Google Chrome where it say added a button that would collapse (or uncollapse if already collapsed) each entry, is that possible? The issue I'm having is that since there is no unique element starting or ending an entry, I'm not sure how to begin this.</p> <p>The general concept is to loop through each "entry" (header being name/location/date) and the text that follows that up until the next header) and allow each "entry" to be collapsible (such as Reddit comments are collapsible).</p> <p>Or for a more simple concept, what if I wanted to mark every other entry with red font? So then all of entry1 would be black font, entry2 would be red font, entry3 would be black font, entry4 would be red font, and so on.</p>
    singulars
    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.
 

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