mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle all whitespace nodes when creating highlights, improve highlight view styling
This commit is contained in:
parent
e0c59434d7
commit
d511d43593
2 changed files with 6 additions and 1 deletions
|
|
@ -118,7 +118,7 @@ export function HighlightView(props: HighlightViewProps): JSX.Element {
|
|||
display: 'inline',
|
||||
padding: '2px',
|
||||
backgroundColor: `rgba(var(--colors-highlightBackground), ${highlightAlpha})`,
|
||||
boxShadow: `1px 0 0 rgba(var(--colors-highlightBackground), ${highlightAlpha}), -1px 0 0 rgba(var(--colors-highlightBackground), ${highlightAlpha})`,
|
||||
boxShadow: `3px 0 0 rgba(var(--colors-highlightBackground), ${highlightAlpha}), -3px 0 0 rgba(var(--colors-highlightBackground), ${highlightAlpha})`,
|
||||
boxDecorationBreak: 'clone',
|
||||
borderRadius: '2px',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -115,6 +115,11 @@ export function makeHighlightNodeAttributes(
|
|||
})
|
||||
const { parentNode, nextSibling } = node
|
||||
|
||||
if (node.textContent && !/[^\t\n\r ]/.test(node.textContent)) {
|
||||
startingTextNodeIndex++
|
||||
continue
|
||||
}
|
||||
|
||||
let isPre = false
|
||||
const nodeElement = node instanceof HTMLElement ? node : node.parentElement
|
||||
if (nodeElement) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue