Search bug - search searches within HTML on my pages

New Member
28 0 0
I think I've come across a search bug. I searched for the word "a". The results, when they came back, were looking in the HTML I had in the pages, so things like a href=mailto: etc. shows up in my search results as text, not the proper mailto: link. Also, I had an unordered list, and somehow that HTML threw the search for a loop, so the search results numbering went haywire at that item and assigned a number, rather than the bullet points I had, when it reached my list. I checked to see if I was closing my HTML tags properly, and I was, so it seems to be something with how Shopify is parsing my html when running a search that's causing the problem.
0 Likes
New Member
28 0 0

I just had this happen for product category, too. What happened is that the word truncation for the item happened in the middle of a link. Therefore, the /a at the end didn’t get read, so the link just kept going.

0 Likes
Shopify Staff
Shopify Staff
2045 0 40

Thanks, i’ll make it so that the html is stripped before indexing the full text.

About the product collections thing: you can add strip_html to the filters in your liquid files.

{{ collection.description | strip_html | truncatewords: 40 }}

this will make sure that all html is stripped and therefore no open tags can be unclosed.

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
0 Likes
New Member
28 0 0

Thankee very much for looking into the search thing! And also for the strip_html command.

:)

0 Likes