Skip to content

Fix broken in-page Chrome search

Administrator requested to merge fix-broken-browser-search into master

Created by: lguychard

Fixes #3160

I found while trying to build a minimal repro case for #3160 that what broke in-page Chrome search was displaying all tokenized <span> elements in a code line as inline-block. This was done to ensure that after-line decorations were displayed correctly (cf comment added in https://github.com/sourcegraph/sourcegraph/commit/7c74b041e5436e780b804c039f5d5949fae2ef17). It would cause the browser to stop considering the content of consecutive spans (eg. <span>Errors</span><span>.</span><span>New</span>) as part of the same string when running an in-page search.

This PR fixes it by wrapping each line's code spans in a <div>, and displaying the line-decoration-attachment-portal as a <div> as well. Both are set to display as inline-block, but individual tokenized spans keep their default display value, inline.

Merge request reports

Loading