algolia / jekyll-algolia

Add fast and relevant search to your Jekyll site
https://community.algolia.com/jekyll-algolia/
MIT License
214 stars 35 forks source link

Duplicate element record item being pushed to algolia #159

Open bsubedi26 opened 4 years ago

bsubedi26 commented 4 years ago

I want to report a bug:

For some reason, when we have a markdown file with a list item, this plugin pushes 2 record for each item. Example markdown:

* Contestant Registration – November 9-11, 2020 
* Rounds – November 10 & 11, 2020 

I logged the record in a hook before it pushes to algolia and for the 1st list item this is whats logged:

{:html=>"<li>\n    <p>Contestant Registration – November 9-11, 2020 </p>\n  </li>", :content=>"\n    Contestant Registration – November 9-11, 2020 \n  ", :headings=>["Dates"], :anchor=>"dates", :custom_ranking=>{:position=>6, :heading=>70}, :title=>"test-cloned-event", :featured_event=>true, :collection=>"events", :tags=>[], :categories=>[], :excerpt_html=>"<h3 id=\"test-event\">Test Event</h3>", :excerpt_text=>"Test Event", :slug=>"test-cloned-event", :type=>"document", :url=>"/test-cloned-event/"}

{:html=>"<p>Contestant Registration – November 9-11, 2020 </p>", :content=>"Contestant Registration – November 9-11, 2020 ", :headings=>["Dates"], :anchor=>"dates", :custom_ranking=>{:position=>7, :heading=>70}, :title=>"test-cloned-event", :featured_event=>true, :collection=>"events", :tags=>[], :categories=>[], :excerpt_html=>"<h3 id=\"test-event\">Test Event</h3>", :excerpt_text=>"Test Event", :slug=>"test-cloned-event", :type=>"document", :url=>"/test-cloned-event/"}

It seems like its creating a record for the list item with the text and another item with just the text. Shouldn't it just create 1 record with an unordered list? For example:

<ul>
  <li>Contestant Registration – November 9-11, 2020<li>
  <li>Rounds – November 10 & 11, 2020<li>
</ul>

What is the current behavior?

Duplicate element record item is being pushed to algolia.

What is your expected behavior?

Duplicate element record item should not be pushed to algolia.

Ruby version used:

2.6.3

Jekyll version used:

3.8.5