probberechts / hexo-theme-cactus

:cactus: A responsive, clean and simple theme for Hexo.
https://probberechts.github.io/hexo-theme-cactus/
MIT License
3.2k stars 784 forks source link

Bottom Lines of Search Results are Cut in Half #272

Closed UM-Li closed 2 years ago

UM-Li commented 3 years ago

I tested on both desktop and mobile versions and got the same result.

Screenshot_20210127_221920

probberechts commented 3 years ago

It looks fine on my side in the demo (see https://probberechts.github.io/hexo-theme-cactus/cactus-dark/public/search/). Which browser and version do you use?

UM-Li commented 3 years ago

Hi, I'm using Firefox 85.0. From what I can see this bug is also present in the Cactus Dark demo.

The search functionality presents results in two different ways when the paragraph is too long:

As far as I have tested this bug only happens when there is no truncation.

Screenshot_20210130_121919

foxB612 commented 3 years ago

Confirm the same bug and I think it's related to substr() in search.js. image It seems that we should use substring() here?