anki-code-highlighter icon indicating copy to clipboard operation
anki-code-highlighter copied to clipboard

Automatically solve "selection splits an HTML node" situations

Open slnc opened this issue 10 months ago • 2 comments

When I select a snippet of text like in the following image, the highlighter complains that the selection splits an HTML node even though I selected complete lines

image

Consider modifying the addon to navigate up the DOM tree to the nearest parent and automatically apply the style. It's less friction for the user and more consistent with how other text programs work (Google Docs, Apple Pages, etc).

This happens on: Anki Version ⁨23.12.1 (1a1d4d54)⁩ Python 3.9.15 Qt 6.5.3 PyQt 6.5.3

Current Code Highlighter plugin.

slnc avatar Apr 20 '24 08:04 slnc

That’s fair. I’m a little busy outside of this project right now though, so this will take time.

gregorias avatar Apr 22 '24 16:04 gregorias

Thanks! I'm using this workaround in the meantime in case it helps: go into source mode, paste the code snippet, go back to wysiwyg mode, select the snippet and apply the highlighter.

slnc avatar Apr 22 '24 18:04 slnc