I paste text from web pages into my sermon notes all the time. On my PC, the pasted text kept a strange shape: a line with only a dot (•), an empty line, and then the real sentence. I had to delete those dot lines by hand after every paste. This post is about removing them, and it took two tries.

The Need: A Dot on Its Own Line

Here is what a paste looked like in my notes:

•

First reason, written as one sentence.

•

Second reason, written as one sentence.

What I wanted was this:

• First reason, written as one sentence.

• Second reason, written as one sentence.

On my phone the same kind of paste was fine. Only the PC had the problem. I think the reason is that the two devices put different data on the clipboard, and I explain that below.

The Proof: Paste, and the Dot Joins Its Sentence

After the second fix, I pasted the same text again on the PC and told Claude: “Now it pastes well, without dot lines.” That is my own check, on one kind of page, so I would call it “works for what I copy most”. I have not tried every site.

The same session also fixed a second small thing. The verse viewer has its own bottom tab bar, and it only listed Home, Read, Search, Favorites, Recent and Memo. The Directory tab and the Listen tab were missing, so from a verse I had to go back first. Both buttons are there now. The bar has eight buttons, which is tight on a narrow phone, and I will look at that screen again.

The Story: A Notes Screen Next to the Verses

My Bible app has a notes tab where I write while I listen to a sermon, and I often paste a short passage from a web page into it. In an earlier version I had already written a paste converter. It turns copied HTML into plain note text: paragraphs, line breaks, lists and links. So I expected this to work, and the dot lines were a small daily annoyance.

The How: Two Clipboard Formats, Two Fixes

When you copy from a web page, the browser puts more than one format on the clipboard. Two matter here:

  • text/html, the page structure
  • text/plain, the plain text

My paste handler reads text/html first and converts it. If there is no structure it knows, it lets the browser paste normally.

First try (did not fix it for me). I assumed the HTML was a list where each item holds a paragraph, like <li><p>…</p></li>. In my converter, the list marker • was written first, and then the paragraph asked for a blank line before itself. That left the dot alone on a line. So I changed two things: a paragraph inside a list item no longer asks for blank lines, and no line break is added right after a list marker. That is correct, but my pasted text was not shaped that way. The dot lines were still there. I told Claude “on the PC the dot lines still appear”.

Second try (worked). The copied page probably drew its bullets with CSS, so the dot arrived as a real character in the text, on its own line. No list tag was involved. So I stopped guessing about the HTML and cleaned the result instead, whichever format it came from:

// join a line that holds only a bullet with the next line of text
function _fixLoneBullets(t) {
  return t.replace(/^([ \t]*)[•·▪●○‣◦■□◆◇][ \t]*\n(?:[ \t]*\n)*(?=[ \t]*\S)/gm, '$1• ')
          .replace(/^[ \t]*[•·▪●○‣◦■□◆◇][ \t]*$\n?/gm, '');
}

The first replace finds a bullet line followed by blank lines and then text, and turns it into • text. The second one removes a bullet that has nothing after it.

Then the paste handler uses it on both paths:

if (text) text = _fixLoneBullets(text);                 // converted from HTML
else if (hasPlainText) {                                // no usable HTML
  const fixed = _fixLoneBullets(plain);
  if (fixed !== plain) text = fixed;                    // only act if something changed
}
if (!text) return;                                      // otherwise normal paste
e.preventDefault();
document.execCommand('insertText', false, text);        // keeps Ctrl+Z and autosave

Two details I wanted to keep. If the text has no dot lines, the handler does nothing, so ordinary paste behaves as before. And insertText keeps undo (Ctrl+Z) and the autosave working.

🗂 Claude.md Rule When a paste bug “is still there” after a fix, a paste can arrive as text/html or as text/plain. Fix the cleaned-up text, not only one format.

I also made a mistake in the middle. I patched the file with a small script, and the script turned the \n and \t inside my regex into real line breaks and tabs. The page was uploaded to the NAS in that broken state for a few minutes. The next step caught it: I ran the page’s inline scripts through a syntax check (new Function(...) in Node) before uploading again.

🗂 Claude.md Rule After patching a JavaScript file with a script, run a syntax check on the inline <script> blocks before copying it to the server.

💬 Prompt that worked “When I copy text from a web page on the PC and paste it into a note, the original format is lost. Lines that hold only a dot appear, and I have to delete them afterward. Also, the Listen tab is at the far right of the bottom bar when I first open the app, but I cannot see it from the verse viewer.”

The answer to the first try was just one more sentence: “On the PC the dot lines still appear.” Short feedback like that was enough to make me look at the clipboard format instead of the list code.

Cost: $0. This is only browser code on my own server, with no outside service.