diff --git a/_plugins/rosindex_generator.rb b/_plugins/rosindex_generator.rb index e7361a1..01cc7bf 100644 --- a/_plugins/rosindex_generator.rb +++ b/_plugins/rosindex_generator.rb @@ -1554,7 +1554,13 @@ def generate(site) p = package.data - readme_filtered = if p['readme'] then self.strip_stopwords(p['readme']) else "" end + # collect rendered readmes into simple text + readmes_text = '' + p['readmes'].each do |readme| + readmes_text << get_text_from_html(readme['readme_rendered']) + end + + readme_filtered = self.strip_stopwords(readmes_text) index += 1 packages_index[distro] << { diff --git a/_ruby_libs/text_rendering.rb b/_ruby_libs/text_rendering.rb index 9642f75..850e118 100644 --- a/_ruby_libs/text_rendering.rb +++ b/_ruby_libs/text_rendering.rb @@ -101,3 +101,7 @@ def get_md_rst_txt(site, path, glob, raw_uri, browse_uri) return file_rendered, file_md end + +def get_text_from_html(html) + return Nokogiri::HTML(html).text +end