fix(search): clean markdown elements in search contents#2457
fix(search): clean markdown elements in search contents#2457
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
afad56b to
85da492
Compare
There was a problem hiding this comment.
This appears to be working but there are a few issues:
- There is a noticeable delay when display search results. The delay Is very noticeable using Safari and less noticeable using Chrome (macOS 14.5). This appears to be a result of storing raw search data, then doing a lot of text processing on the data each time a search query is performed. Why not do the processing before storing the search data so we only have to do that processing one time and not before rending searching results?
- E2E tests are failing. This may be result of bringing the branch up to date with
develop.
CC: @sy-records
|
Thanks so much @Koooooo-7 for working on this! I've also tried the latest Preview in this thread, which I assume has this change included, and noticed two things:
I hope the above helps. |
|
Hi @jhildenbiddle @paulhibbitts --- |
Make sense. |
thx for the nice catch, notes the styling issue. 👌 |
3f6d18d to
144b4f8
Compare
paulhibbitts
left a comment
There was a problem hiding this comment.
Thanks so much for the update @Koooooo-7 ! The display of preceding ellipses look good 🙂
I've done some more testing, and have a few comments/questions:
- Empty ellipses (......) are being displayed when searching for items matching only a Header and no immediate content below. For example, search for "Headings" which is on the UI Kit page. If no content within ellipses perhaps do not display ellipses/content at all?
- Should we include Markdown image paths/names? For example, search for "icon.svg"?
Nice catch! I didn't aware that there may have a empty search ---- Updated
For now, I keep the images path and names/titles meta for searching, although we can not see it in the content directly. |
|
Awesome @Koooooo-7 , looks good! Thank you very much 🙏🏼 |
I checked the previews behavior, it is different from v4 result since last year. Which has a pure wrong result highlight for Current behavior in this PR more looks like a "patch" to correct search contents, but we still need figure it out when and why the search content changed. Update: There is a potential issue for the |
|
ping @sy-records |

Summary
Changes
TODO In v5+: move it as a async job instead of handing main thread too long, especially with large contents. (it looks fine in our site for now)
marked v13+with pure new renderer rewrite.?>!>of docsify either....to matched contents as truncation surroundings.Snapshot (before -> after)
Related issue, if any:
What kind of change does this PR introduce?
Bugfix
For any code change,
Does this PR introduce a breaking change?
Yes
No
Tested in the following browsers: