feat: restrict element selection to text elements only

- Remove containers (section, div, article, etc.) from selectable elements
- Remove media elements (img, figure, ul, ol, table) from selection
- Keep text elements: headings, paragraphs, links, formatting tags
- Add figcaption as selectable, remove span

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2025-12-10 13:28:35 +01:00
parent 0b511389da
commit 6b578012b7

View file

@ -236,7 +236,7 @@ const clearSelectedPages = () => {
selectedPages.value = []; selectedPages.value = [];
}; };
// Content elements that can trigger ElementPopup // Text elements that can trigger ElementPopup (excluding containers, images, etc.)
const CONTENT_ELEMENTS = [ const CONTENT_ELEMENTS = [
'P', 'P',
'H1', 'H1',
@ -245,34 +245,17 @@ const CONTENT_ELEMENTS = [
'H4', 'H4',
'H5', 'H5',
'H6', 'H6',
'IMG',
'FIGURE',
'FIGCAPTION',
'UL',
'OL',
'LI',
'BLOCKQUOTE', 'BLOCKQUOTE',
'PRE', 'LI',
'CODE',
'TABLE',
'THEAD',
'TBODY',
'TR',
'TH',
'TD',
'A', 'A',
'SPAN',
'STRONG', 'STRONG',
'EM', 'EM',
'B', 'B',
'I', 'I',
'U', 'U',
'ARTICLE', 'CODE',
'SECTION', 'PRE',
'ASIDE', 'FIGCAPTION',
'HEADER',
'FOOTER',
'NAV',
]; ];
// Check if element is a content element (or find closest content parent) // Check if element is a content element (or find closest content parent)