Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure in-page search works, despite any markup #125

Closed
aantron opened this issue Apr 17, 2018 · 12 comments
Closed

Make sure in-page search works, despite any markup #125

aantron opened this issue Apr 17, 2018 · 12 comments
Labels

Comments

@aantron
Copy link
Contributor

aantron commented Apr 17, 2018

Ideally, we could even somehow test for this automatically. Ideas welcome.

Noted by @rleonid in https://discuss.ocaml.org/t/1841/10.

@aantron aantron added the output label Apr 17, 2018
@leostera leostera mentioned this issue Oct 8, 2018
13 tasks
@rizo
Copy link
Collaborator

rizo commented Oct 8, 2018

Is this just about the -> markup using a regular dash sign? If so, I believe it's already fixed in master. If not, could you please give other examples?

@dbuenzli
Copy link
Contributor

dbuenzli commented Oct 8, 2018

It may be larger than that see #19 (comment)

@aantron
Copy link
Contributor Author

aantron commented Oct 9, 2018

That was the only specific example, to my knowledge.

@aantron aantron closed this as completed Oct 12, 2018
@yawaramin
Copy link
Contributor

In page search is not working. E.g. go to https://b0-system.github.io/odig/doc/dolog/Log/index.html#val-info . Then search in page for val info. No results.

@hcarty
Copy link
Member

hcarty commented Jun 21, 2019

@yawaramin I get val info highlighted + found when searching that page in Firefox. Do you potentially have a browser plugin altering the page?

@yawaramin
Copy link
Contributor

@hcarty you're right, it's working in FF. I also checked and confirmed it's working in Safari. However it is not working in Chrome incognito with no extensions. Strange. Could be a Chrome bug...

@hcarty
Copy link
Member

hcarty commented Jun 21, 2019

Ah - yep, confirmed that it's not working on Chrome here either.

@dbuenzli
Copy link
Contributor

I recently noticed this aswell it seems if you set display: inline-block on span's it inhibits in-page search across these spans.

If someone knows where this can be filed against chrome here's a repro case (I submited an issue via chrome's UI but the experience felt like writing to /dev/null) :

<!DOCTYPE html>
<html>
    <head>
      <meta charset="utf-8">
      <title>inline-block search bug</title>
      <style type="text/css">
        span { display: inline-block }
      </style>
    </head>
    <body>
      <p>
        <span>Is</span> <span>this</span> <span>searchable?</span>
      </p>
      <p>
        Is this searchable?
      </p>
    </body>
</html>

@yawaramin
Copy link
Contributor

@dbuenzli Chrome bugs are filed against the Chromium project, so https://bugs.chromium.org/p/chromium/issues/list . I tried a couple of different searches there but not finding anything more relevant than https://bugs.chromium.org/p/chromium/issues/detail?id=809886 , which talks about text-selection weirdness for inline-block spans, which also seems to present on odoc pages. May be related.

@dbuenzli
Copy link
Contributor

I personally don't have gaccount (and I'm not willing to get one) but in any case that should not be a problem with odoc's stylesheet, as far as I can see it doesn't use inline-block on code spans.

odig's stylesheet does however do this, maybe should disable it -- but then we loose the nice line signature line breaking that was implemented by @trefis. Not sure if there's another way to achieve the same effect (well there must be, that's CSS after all...).

@dbuenzli
Copy link
Contributor

So I found a workaround. Rather than making spans display: inline-block make them white-space: nowrap. Cf fiddle here https://jsfiddle.net/s59g24vd/

dbuenzli added a commit to b0-system/odig that referenced this issue Jan 29, 2021
Use white-space:nowrap rather than display:inline-block
which breaks Chrome in-page search.

See ocaml/odoc#125
@dbuenzli
Copy link
Contributor

So I found a workaround. Rather than making spans display: inline-block make them white-space: nowrap

Except CSS being CSS this has other unwanted effects on narrow viewports. If the span width exceeds the container width this overflows and it's not possible to switch back to wrapping (which entails horizontal scrolling).

This is frustrating display: inline-block really does the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants