gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
54 stars 3 forks source link

Automatically solve "selection splits an HTML node" situations #80

Closed slnc closed 1 month ago

slnc commented 1 month ago

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.

gregorias commented 1 month ago

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

slnc commented 1 month ago

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.