Plugin icon

Rendered Markup Selection Fix

Description

Keeps mouse selections from splitting hidden Markdown formatting characters when render markup is enabled

Additional Information

Links:
Maintainers: bwat47
Version:1.0.1
Minimum app version:3.7
Downloads: This version:3
Last updated:2026-11-18T03:10:23Z

[!note] This plugin was created entirely with AI tools

Rendered Markup Selection Fix

Fixes mouse selections in Joplin's Markdown editor (with render markup enabled) picking up only one half of a pair of hidden formatting characters (laurent22/joplin#16546).

The problem

With render markup enabled, **bold** shows as bold, and the ** marks are hidden. The positions on either side of a hidden mark look the same, so a mouse selection can land on either side. When you release the mouse, Joplin reveals the marks and the selection often turns out to be **bold or bold**, or a heading selection is missing its #.

What it does

While you drag, each selection endpoint that sits inside a hidden mark is snapped:

  • If the selection covers the construct's whole visible text, both marks are included (**bold**, # Heading, [label](url)).
  • Otherwise the dangling mark is excluded (e.g. selecting part of a bold word never picks up a lone **).

The adjustment happens while the marks are still hidden, so the selection looks the same and doesn't jump when the marks are revealed.

Handled: bold/italic (including nested), inline code, fenced code blocks, strikethrough, highlight (==), insert (++), links, headings, block quotes, and the inline HTML tags Joplin hides (<sub>, <sup>, <strike>, and <span>). Bullet markers are left alone: they render as a visible bullet, so there is no ambiguity about which side of them you selected.

The plugin only adjusts endpoints next to marks that are actually hidden at that moment, so it does nothing when render markup is disabled or the marks are already revealed. Only mouse selections are affected; keyboard selection is unchanged.

Requirements

  • Joplin 3.7 or newer
  • Markdown editor (CodeMirror 6) with render markup enabled