Merge pull request #2442 from omnivore-app/fix/web-highlight-tables
Handle all whitespace nodes when creating highlights, improve highlight view styling
This commit is contained in:
@ -113,12 +113,12 @@ export function HighlightView(props: HighlightViewProps): JSX.Element {
|
||||
<StyledQuote>
|
||||
<SpanBox
|
||||
css={{
|
||||
'> *': {
|
||||
'*': {
|
||||
m: '0px',
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user