javascript:(()=>{constboardsEnabled=["g","vg"];constthreadsEnabled=["/lmg/","/aids/"];constrecapText=["Recent Highlights from the Previous Thread","Ghetto Recap",];constisArchive=location.host==="desuarchive.org";constopSelector=isArchive?".post_is_op":".post.op";constpostSelector=isArchive?".post_wrapper":".postMessage";constpreviousLinkSelector=isArchive?'.backlink[href*="thread"]':'blockquote a[href*="thread"]';constquoteSelector=isArchive?"span.greentext":"span.quote";constbacklinkClass=isArchive?"backlink":"quotelink";constboard=location.href.match(/\/(\w+)\/thread\//)?.[1];constisThread=threadsEnabled.some((v)=>document.querySelector(opSelector)?.textContent.match(v)!==null);if(boardsEnabled.indexOf(board)!==-1&&isThread){constrecapPosts=[...document.querySelectorAll(postSelector)].filter((v)=>recapText.some((text)=>v.textContent.toLowerCase().includes(text.toLowerCase())));for(constpostofrecapPosts){constpreviousThreadUrl=document.querySelector(previousLinkSelector).href;constthreadId=previousThreadUrl.match(/thread\/(\d{9})/)[1];letpostHTML=post.innerHTML;constquoteIds=postHTML.matchAll(/(?<!>)>(\d{9})/g);for(const[,id]ofquoteIds){constre=newRegExp(`(?<!>)>${id}`,"g");constbacklink=`<ahref="/${board}/thread/${threadId}#p${id}"class="${backlinkClass}"data-function="highlight"data-backlink="true"data-board="${board}"data-post="${id}">>>${id}</a>`;postHTML=postHTML.replaceAll(re,backlink);}post.innerHTML=postHTML;}}})();
//==UserScript==//@nameLinkify4chanRecap//@version1//@includehttps://boards.4chan.org/*//@includehttps://desuarchive.org/*//@grantnone//==/UserScript==(()=>{constboardsEnabled=["g","vg"];constthreadsEnabled=["/lmg/","/aids/"];constrecapText=["Recent Highlights from the Previous Thread","Ghetto Recap",];constisArchive=location.host==="desuarchive.org";constopSelector=isArchive?".post_is_op":".post.op";constpostSelector=isArchive?".post_wrapper":".postMessage";constpreviousLinkSelector=isArchive?'.backlink[href*="thread"]':'blockquote a[href*="thread"]';constquoteSelector=isArchive?"span.greentext":"span.quote";constbacklinkClass=isArchive?"backlink":"quotelink";constboard=location.href.match(/\/(\w+)\/thread\//)?.[1];constisThread=threadsEnabled.some((v)=>document.querySelector(opSelector)?.textContent.match(v)!==null);if(boardsEnabled.indexOf(board)!==-1&&isThread){constrecapPosts=[...document.querySelectorAll(postSelector)].filter((v)=>recapText.some((text)=>v.textContent.toLowerCase().includes(text.toLowerCase())));for(constpostofrecapPosts){constpreviousThreadUrl=document.querySelector(previousLinkSelector).href;constthreadId=previousThreadUrl.match(/thread\/(\d{9})/)[1];letpostHTML=post.innerHTML;constquoteIds=postHTML.matchAll(/(?<!>)>(\d{9})/g);for(const[,id]ofquoteIds){constre=newRegExp(`(?<!>)>${id}`,"g");constbacklink=`<ahref="/${board}/thread/${threadId}#p${id}"class="${backlinkClass}"data-function="highlight"data-backlink="true"data-board="${board}"data-post="${id}">>>${id}</a>`;postHTML=postHTML.replaceAll(re,backlink);}post.innerHTML=postHTML;}}})();