<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marcel Losso Forte</title>
    <description>The latest articles on DEV Community by Marcel Losso Forte (@marcellosso).</description>
    <link>https://dev.to/marcellosso</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3491249%2F60974ab1-16c6-454a-b365-0aa6f88cd952.jpeg</url>
      <title>DEV Community: Marcel Losso Forte</title>
      <link>https://dev.to/marcellosso</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcellosso"/>
    <language>en</language>
    <item>
      <title>Highlighting text without wrapping it in spans: the CSS Custom Highlight API</title>
      <dc:creator>Marcel Losso Forte</dc:creator>
      <pubDate>Wed, 04 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/marcellosso/highlighting-text-without-wrapping-it-in-spans-the-css-custom-highlight-api-2h5o</link>
      <guid>https://dev.to/marcellosso/highlighting-text-without-wrapping-it-in-spans-the-css-custom-highlight-api-2h5o</guid>
      <description>&lt;p&gt;The &lt;strong&gt;CSS Custom Highlight API&lt;/strong&gt; is a browser API that lets you style arbitrary ranges of text by registering &lt;code&gt;Range&lt;/code&gt; objects in a &lt;code&gt;Highlight&lt;/code&gt;, adding it to &lt;code&gt;CSS.highlights&lt;/code&gt; under a name, and targeting that name with the &lt;code&gt;::highlight()&lt;/code&gt; pseudo-element. The DOM stays exactly as it was: no &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, no &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;, no extra nodes.&lt;/p&gt;

&lt;p&gt;I ran into this while building a highlights-and-notes feature, and it changed how I think about the problem. This post covers why the old approach hurts, how the native API works, what support looks like today, and what you still have to build yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is wrong with wrapping highlights in spans?
&lt;/h2&gt;

&lt;p&gt;For about fifteen years, the standard way to highlight text on a web page was to split text nodes and wrap the pieces in elements. mark.js wraps matches in &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;. Rangy's highlighter and web-highlighter wrap them in &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;. It works, but it has costs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You are editing a DOM someone else owns.&lt;/strong&gt; In React, Vue or Svelte, the framework assumes it controls the nodes it rendered. If a library splits a text node and inserts a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, the next re-render can throw the highlight away, or fail outright when the framework tries to update a node that is no longer where it expected. If you've ever seen &lt;code&gt;Failed to execute 'removeChild' on 'Node'&lt;/code&gt; after a third-party script touched your markup, you know what this looks like.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overlapping highlights get messy.&lt;/strong&gt; Two highlights that partly overlap need nested or split wrappers, and removing one means stitching text nodes back together correctly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selectors and styles change.&lt;/strong&gt; &lt;code&gt;p &amp;gt; a&lt;/code&gt; or &lt;code&gt;:first-child&lt;/code&gt; can stop matching once extra elements appear. Copy and paste, &lt;code&gt;textContent&lt;/code&gt; offsets and screen readers can all pick up the new structure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cleanup is your problem.&lt;/strong&gt; Every "remove highlight" has to unwrap and normalize the nodes, or the DOM slowly fills with fragments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is a bug in those libraries. When they were written, wrapping was the only way to paint text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does the CSS Custom Highlight API work?
&lt;/h2&gt;

&lt;p&gt;There are three pieces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Range&lt;/code&gt;&lt;/strong&gt;: the same DOM &lt;code&gt;Range&lt;/code&gt; you get from &lt;code&gt;document.createRange()&lt;/code&gt; or &lt;code&gt;new Range()&lt;/code&gt;, with a start and end inside text nodes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Highlight&lt;/code&gt;&lt;/strong&gt;: a set-like object that holds one or more ranges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;CSS.highlights&lt;/code&gt;&lt;/strong&gt;: a registry (a &lt;code&gt;HighlightRegistry&lt;/code&gt;, which behaves like a &lt;code&gt;Map&lt;/code&gt;) where you give each &lt;code&gt;Highlight&lt;/code&gt; a name. CSS then styles that name with &lt;code&gt;::highlight(name)&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the minimal version, with no library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;The quick brown fox jumps over the lazy dog.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;::highlight&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;note&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#fde68a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inherit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;CSS&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undefined&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;highlights&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;CSS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;textNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;intro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;firstChild&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Range&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;textNode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// start of "quick"&lt;/span&gt;
  &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;textNode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// end of "fox"&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;highlight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Highlight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;CSS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;highlights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;note&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;highlight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Later, to remove it:&lt;/span&gt;
  &lt;span class="c1"&gt;// CSS.highlights.delete('note');&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open DevTools after running this: the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; still has a single text node. The browser paints the range, but nothing in the tree changed, so React (or anything else) can re-render the paragraph and the highlight is still painted as long as the range points at live nodes.&lt;/p&gt;

&lt;p&gt;A few things the spec deliberately limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Only some properties apply&lt;/strong&gt; inside &lt;code&gt;::highlight()&lt;/code&gt;: &lt;code&gt;color&lt;/code&gt;, &lt;code&gt;background-color&lt;/code&gt;, &lt;code&gt;text-decoration&lt;/code&gt; and its longhands, &lt;code&gt;text-shadow&lt;/code&gt;, and a handful of others. No &lt;code&gt;padding&lt;/code&gt;, no &lt;code&gt;border&lt;/code&gt;, no layout changes. That is the point: painting, not layout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ranges are live.&lt;/strong&gt; If the DOM under a range changes, the range moves or collapses with it. That's great for small edits and a problem when a framework replaces the whole node (more on that below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Highlights are not elements, so they get no events.&lt;/strong&gt; There's no &lt;code&gt;click&lt;/code&gt; on a highlight. You hit-test yourself: get the caret position from the pointer with &lt;code&gt;document.caretPositionFromPoint()&lt;/code&gt; and check which range contains it, or compare the pointer against &lt;code&gt;range.getClientRects()&lt;/code&gt;. A newer &lt;code&gt;CSS.highlights.highlightsFromPoint()&lt;/code&gt; does this for you, but support is still partial (see below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Priority.&lt;/strong&gt; When highlights overlap, &lt;code&gt;highlight.priority&lt;/code&gt; decides which one paints on top.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which browsers support the CSS Custom Highlight API?
&lt;/h2&gt;

&lt;p&gt;Checked on 3 November 2026 against MDN's browser-compat-data and the web-features "Custom highlights" entry:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Browser&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;Highlight&lt;/code&gt; / &lt;code&gt;CSS.highlights&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;::highlight()&lt;/code&gt; styling&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chrome / Edge&lt;/td&gt;
&lt;td&gt;105 (2022)&lt;/td&gt;
&lt;td&gt;105&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safari (macOS and iOS)&lt;/td&gt;
&lt;td&gt;17.2 (December 2023)&lt;/td&gt;
&lt;td&gt;17.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Firefox&lt;/td&gt;
&lt;td&gt;140&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;partial from 140 to 148&lt;/strong&gt;: &lt;code&gt;text-decoration&lt;/code&gt; works from 146, &lt;code&gt;text-shadow&lt;/code&gt; from 149. Full from 149&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The feature became &lt;strong&gt;Baseline "newly available" on 24 March 2026&lt;/strong&gt;, when Firefox 149 shipped full &lt;code&gt;::highlight()&lt;/code&gt; support. Two caveats worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Safari, &lt;code&gt;::highlight()&lt;/code&gt; styles are ignored on text that also has &lt;code&gt;user-select: none&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CSS.highlights.highlightsFromPoint()&lt;/code&gt; is only in Chrome 140+ and Firefox 150+ (Safari has it in preview), so keep a manual hit-test fallback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need to support older browsers, there is no polyfill that keeps the "no DOM changes" property. You either fall back to wrapping, or you simply don't show highlights there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you still have to build yourself?
&lt;/h2&gt;

&lt;p&gt;The native API paints ranges. That's all it does. For a real highlights-and-notes feature, you still need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Persistence.&lt;/strong&gt; A &lt;code&gt;Range&lt;/code&gt; is a pair of node references. It can't be saved to &lt;code&gt;localStorage&lt;/code&gt; or a database. You need to serialize it into something stable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-anchoring.&lt;/strong&gt; When the page loads again, or the content was edited, or a framework re-rendered and replaced the text nodes, you have to find the text again and build fresh ranges. Character offsets alone break as soon as one word changes above your highlight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selection UI.&lt;/strong&gt; Turning a user's selection into a highlight, and showing a toolbar or note editor next to it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hit-testing&lt;/strong&gt;, as above, to open the note when someone clicks a highlight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework lifecycle.&lt;/strong&gt; Creating and destroying everything when a component mounts and unmounts, and not running on the server during SSR.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does penciled build on top of it?
&lt;/h2&gt;

&lt;p&gt;This is the part where I talk about my own project. I wrote &lt;strong&gt;penciled&lt;/strong&gt; (penciled.org, JavaScript highlights &amp;amp; notes library), an MIT-licensed library of about 15 kB that does the list above on top of the Custom Highlight API. It never inserts elements into your content, and it has no wrapping fallback.&lt;/p&gt;

&lt;p&gt;The default setup, with a built-in toolbar and note editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;annotate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;penciled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;penciled/styles.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;penciled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;annotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#article&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;documentId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;local&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// or 'memory', or your own adapter with load/save&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;off&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;penciled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;annotation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;annotation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What it handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Persistence&lt;/strong&gt;: &lt;code&gt;localStorage&lt;/code&gt; by default, or a custom storage adapter (an object with &lt;code&gt;load&lt;/code&gt; and &lt;code&gt;save&lt;/code&gt;, plus optional &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt;) to sync with your backend. &lt;code&gt;export()&lt;/code&gt; and &lt;code&gt;import()&lt;/code&gt; move annotations around, and &lt;code&gt;toW3C()&lt;/code&gt; converts them to the W3C Web Annotation format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anchoring&lt;/strong&gt;: each annotation stores the quoted text, a short prefix and suffix, and start/end positions. On load, penciled tries the stored position, then exact matches of the quote, then a fuzzy match, and only accepts a result above a confidence threshold. If the text really is gone, the annotation isn't silently painted in the wrong place. It's marked as an &lt;strong&gt;orphan&lt;/strong&gt;, fires an &lt;code&gt;orphan&lt;/code&gt; event and stays in storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notes&lt;/strong&gt;: each highlight can carry a note, with a color and an indicator for highlights that have notes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt;: &lt;code&gt;penciled/react&lt;/code&gt; exports an &lt;code&gt;&amp;lt;Annotatable&amp;gt;&lt;/code&gt; component and a &lt;code&gt;useAnnotations()&lt;/code&gt; hook. It's SSR-safe, because the instance is only created in an effect, and React can re-render the annotated content as often as it likes:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Annotatable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;penciled/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;penciled/styles.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;children&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Annotatable&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"article"&lt;/span&gt; &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;documentId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Annotatable&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Headless&lt;/strong&gt;: &lt;code&gt;penciled/headless&lt;/code&gt; (about 6 kB) is the same engine without the UI. You get &lt;code&gt;select&lt;/code&gt; events with the selected range and build your own toolbar:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;annotate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;penciled/headless&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;penciled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;annotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#article&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;penciled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;select&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;annotation&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;editable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// position your own button using context.range.getBoundingClientRect()&lt;/span&gt;
  &lt;span class="c1"&gt;// then: penciled.create(context.range, { color: 'yellow' });&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Highlights are registered as named highlights (&lt;code&gt;penciled-&amp;lt;color&amp;gt;&lt;/code&gt;, &lt;code&gt;penciled-&amp;lt;color&amp;gt;-noted&lt;/code&gt;, &lt;code&gt;penciled-active&lt;/code&gt;), so you can style them with ordinary &lt;code&gt;::highlight()&lt;/code&gt; rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it compare to mark.js, Rangy and other options?
&lt;/h2&gt;

&lt;p&gt;Honestly, it depends on what you need. These numbers come from my own comparison page, measured on 22 October 2026 (sizes are min+gzip):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Library&lt;/th&gt;
&lt;th&gt;How it paints&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;mark.js&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;wraps in &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;~6.2 kB&lt;/td&gt;
&lt;td&gt;Built for search-term highlighting, not saved annotations. Last release 8.11.1 in January 2018, still ~1.9M weekly downloads.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rangy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;wraps in &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;~22.7 kB&lt;/td&gt;
&lt;td&gt;A broad range/selection toolkit with a highlighter module. Latest 1.3.2.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;web-highlighter&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;wraps in &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;~9.4 kB&lt;/td&gt;
&lt;td&gt;Persistence-oriented, and works back to IE11, which the native API can't.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;@recogito/text-annotator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;separate overlay layer&lt;/td&gt;
&lt;td&gt;~22.4 kB&lt;/td&gt;
&lt;td&gt;BSD-3, W3C annotation model, strong for collaborative and scholarly annotation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Annotator.js&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;jQuery-based&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Last released in 2015. Hypothesis was originally built on it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;penciled&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CSS Custom Highlight API&lt;/td&gt;
&lt;td&gt;~15 kB (~6 kB headless)&lt;/td&gt;
&lt;td&gt;No DOM changes, persistence and fuzzy re-anchoring built in. Pre-1.0, with far fewer users (~640 weekly downloads).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;My rough guide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Highlighting search matches&lt;/strong&gt; on a static page? mark.js is small and battle-tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Need IE11 or very old browsers?&lt;/strong&gt; You need a wrapping library such as web-highlighter or Rangy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaborative, shared annotation&lt;/strong&gt; with accounts and groups? Look at Hypothesis or Recogito.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistent personal highlights and notes in a modern app, especially one rendered by React&lt;/strong&gt;, where you can't let a library rewrite your markup? That's the case I built penciled for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only need to paint a few ranges, you don't need any library. The ten lines of native code above are enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where can I try it?
&lt;/h2&gt;

&lt;p&gt;Docs and a live demo are at &lt;a href="https://www.penciled.org" rel="noopener noreferrer"&gt;penciled.org&lt;/a&gt;, and the source is on &lt;a href="https://github.com/marcellosso/penciled" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. There's also a free browser extension for Chrome, Firefox and Edge built on the same library, if you just want to highlight pages you read.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Marcel Losso, the creator and maintainer of penciled, so weigh my comparison accordingly. Corrections and issues are very welcome on GitHub.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>I Gave a Monkey 10 Million Keystrokes a Day on My GitHub Profile (It's Trying to Write Hamlet)</title>
      <dc:creator>Marcel Losso Forte</dc:creator>
      <pubDate>Tue, 27 Oct 2026 01:24:30 +0000</pubDate>
      <link>https://dev.to/marcellosso/i-gave-a-monkey-10-million-keystrokes-a-day-on-my-github-profile-its-trying-to-write-hamlet-18mj</link>
      <guid>https://dev.to/marcellosso/i-gave-a-monkey-10-million-keystrokes-a-day-on-my-github-profile-its-trying-to-write-hamlet-18mj</guid>
      <description>&lt;p&gt;Give a monkey a typewriter and infinite time, and it will eventually type the works of Shakespeare. That's the &lt;a href="https://en.wikipedia.org/wiki/Infinite_monkey_theorem" rel="noopener noreferrer"&gt;infinite monkey theorem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I got bored of a normal GitHub profile README. So I put the theorem on mine.&lt;/p&gt;

&lt;p&gt;Every day a GitHub Action hands my pixel monkey 10,000,000 random keystrokes and checks whether any of them landed on Hamlet. The stats update on the README. The longest match so far is "o the bla" — nine characters, somewhere in Act IV. At this pace, finishing the play takes about 10^237421 years. Cool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The CLI the monkey pretends to run&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;monkey &lt;span class="nt"&gt;--type&lt;/span&gt; &lt;span class="nt"&gt;--keys&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10M
&lt;span class="c"&gt;# or, when someone feeds a banana:&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;monkey &lt;span class="nt"&gt;--type&lt;/span&gt; &lt;span class="nt"&gt;--banana&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;@you
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood it's just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node scripts/monkey.mjs &lt;span class="nb"&gt;type&lt;/span&gt;    &lt;span class="c"&gt;# daily: 10M random keystrokes&lt;/span&gt;
node scripts/monkey.mjs feed    &lt;span class="c"&gt;# banana issue: +1M keys + reply&lt;/span&gt;
node scripts/monkey.mjs render  &lt;span class="c"&gt;# redraw SVGs + README from state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How the typing works&lt;/strong&gt;&lt;br&gt;
27 keys (a–z + space), uniform, via crypto.randomBytes. Reject bytes ≥ 243 so every key stays equally likely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALPHABET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abcdefghijklmnopqrstuvwxyz &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DAILY_KEYSTROKES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="nx"&gt;_000_000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;byte&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;65536&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;byte&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;243&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 243 = 9 * 27&lt;/span&gt;
      &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ALPHABET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;byte&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// then find the longest substring that also appears in Hamlet…&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hamlet is normalized (lowercase letters, runs of junk → one space). Matches are looked up in length-keyed Sets, then mapped back to Act / Scene / line for the SVG quote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feed the monkey&lt;/strong&gt;&lt;br&gt;
Anyone can open a banana issue. Each one buys 1,000,000 extra keystrokes right away. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiw16sr5lvrtp315hd7vu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiw16sr5lvrtp315hd7vu.png" alt="A button with " width="621" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Action replies with the snippet and your avatar lands on the donor wall.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;🐒🍌 &lt;span class="ge"&gt;*nom.*&lt;/span&gt; Thanks @you! That banana bought 1,000,000 keystrokes. Somewhere in the mess:
to hell allegiance vows to the bla…
                    ^^^^^^^^^
&lt;span class="gs"&gt;**"o the bla"**&lt;/span&gt; (9 characters) appears in Hamlet, Act IV, Scene I:
&lt;span class="gt"&gt;&amp;gt; To hell, allegiance! Vows, to the blackest devil!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No signup. GitHub Issues as a game controller.&lt;/p&gt;

&lt;p&gt;The README is generated, not edited&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Generated by scripts/monkey.mjs. Edit the script, not this file.&lt;/span&gt;
&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;README.md`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;readme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Banners, stats, feed button and project cards are SVGs (light + dark), fonts embedded as base64 so every viewer sees the same type. Full source: &lt;a href="https://github.com/marcellosso/marcellosso/blob/main/scripts/monkey.mjs" rel="noopener noreferrer"&gt;scripts/monkey.mjs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why bother&lt;/strong&gt;&lt;br&gt;
Profile READMEs are usually a skill grid and a wavy “Hi I'm…”. This one is an experiment you can poke. The cards under the monkey point at things I ship — &lt;a href="https://www.penciled.org/" rel="noopener noreferrer"&gt;penciled.js&lt;/a&gt;, &lt;a href="https://www.getlocalhost.app/" rel="noopener noreferrer"&gt;localhost&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/better-auth-localization" rel="noopener noreferrer"&gt;better-auth-localization&lt;/a&gt; — but this post is about the monkey, not a launch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it&lt;/strong&gt;&lt;br&gt;
Profile: &lt;a href="https://github.com/marcellosso" rel="noopener noreferrer"&gt;github.com/marcellosso&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drop a banana. Ruin (or slightly improve) the monkey's day.&lt;/p&gt;

&lt;p&gt;If the monkey ever finishes Hamlet, I'll buy everyone a coffee. Don't hold your breath.&lt;/p&gt;

</description>
      <category>github</category>
      <category>javascript</category>
      <category>fun</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
