pola-rs / polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust
https://docs.pola.rs
Other
28.75k stars 1.8k forks source link

Odd formatting when a search in the docs contains part of the word "Examples" #16973

Open bertiewooster opened 2 months ago

bertiewooster commented 2 months ago

Description

When searching the Python API documentation, if the user searches for text that happens to have part of the word "Examples", they then go to a page with an Examples heading, the search text can be split over multiple lines. For example, if you search for "pl", then click polars.DataFrame.drop_in_place, the heading "Examples" is split over three lines with the search term "pl" on its own line:

Exam pl es

Word examples split over multiple lines pl

This is a problem for the Examples heading but not Parameters, for example if you search for "am" then click polars.align_frames:

Word Examples split over multiple lines am but not Parameters

Perhaps this has to do with the interaction between the highlighting tool and the formatting of the Examples heading?

Link

https://docs.pola.rs/api/python/stable/search.html?q=pl

cmdlineluser commented 2 months ago

It seems the highlighter wraps in a span tag:

<span class="highlighted" style="">am</span>

And the parent <p class="rubic" tag in this case is using flexbox, which has something to do with the resulting behaviour.

Screen Shot