CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.34k stars 100 forks source link

Why Search results includes `_ END_PAGEFIND_WEIGHT` #430

Closed ATQQ closed 11 months ago

ATQQ commented 11 months ago

Why Search results include __END_PAGEFIND_WEIGHT and ___ PAGEFIND_ANCHOR___h1

image

bglw commented 11 months ago

Hey @ATQQ 👋 — This is definitely a bug on my end, sorry about that! Pagefind uses those labels internally while parsing, but they aren't supposed to escape the machinery!

I'll work on a fix for this.

ATQQ commented 11 months ago

Looking forward to your fix, as pagefind upgraded v1 this week, I found this problem in the process of upgrading my plugin vitepress-plugin-pagefind


As an aside, the features I discovered on pagefind alpha a long time ago don't seem to exist on 1.x latest?

bglw commented 11 months ago

I'll work on a fix today :)

As an aside, the features I discovered on pagefind alpha a long time ago don't seem to exist on 1.x latest?

What features specifically? I don't think anything was removed between an alpha release and 1.x

ATQQ commented 11 months ago

Below is the alpha version of the search results, it looks a little different from the latest results, such as anchors

image

Looks like it's the latest bug?

bglw commented 11 months ago

Ah — yes, the internal tokens leaking out is also causing them to not be picked up as anchors, so they're missing there. Upcoming change will fix both 🙂

ATQQ commented 11 months ago

Then look forward to your repair, Thanks♪(· ω ·)ノ❤️

bglw commented 11 months ago

Hi @ATQQ 👋

Pagefind v1.0.3-rc0 hopefully fixes this, but I'll wait for a confirmation on this before publishing it fully. Would you be able to give that prerelease a quick test? 🙏

ATQQ commented 11 months ago

ok ,Give me some time. I'm currently outdoors

bglw commented 11 months ago

No rush! It's evening over here, so it might sit until morning 🙂

ATQQ commented 11 months ago

It should look normal, very perfect 😃

image

But there seems to be a new problem,Search results with some extra Spaces

bglw commented 11 months ago

~Ah, interesting. I was aware of that as an issue, but I did think it was also an issue in the 0.x releases.~

~I'll have a look and see why that got introduced, and if there is an easy fix.~

( Thanks for the quick test ❤️ )

I see how that has occurred — I'll get that fixed up before releasing these changes. (Likely tomorrow)

bglw commented 11 months ago

Hey @ATQQ — v1.0.3-rc1 is out and I think it's good to go!

I'll look at releasing it in ~12 hours. Let me know if you get a chance to try it beforehand, all good if not ☺️

ATQQ commented 11 months ago

I tested it and it was fine this time, very nice.

You're so efficient 👍 💯 @bglw

bglw commented 11 months ago

Released in v1.0.3 🙂