mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
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:
commit
ba5a8431cd
2 changed files with 7 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue