mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FEATURE: Make links indexable. (#6285)
This commit is contained in:
parent
a71fe16647
commit
975a72ab7a
|
@ -201,6 +201,11 @@ class SearchIndexer
|
|||
scrubbed << attributes["data-youtube-title"]
|
||||
scrubbed << " "
|
||||
end
|
||||
if attributes["href"]
|
||||
scrubbed << " "
|
||||
scrubbed << attributes["href"]
|
||||
scrubbed << " "
|
||||
end
|
||||
end
|
||||
|
||||
def characters(string)
|
||||
|
|
|
@ -21,6 +21,14 @@ describe SearchIndexer do
|
|||
expect(scrubbed).to eq(" Metallica Mixer Explains Missing Bass on 'And Justice for All' [Exclusive] ")
|
||||
end
|
||||
|
||||
it 'extract a link' do
|
||||
html = "<a href='http://meta.discourse.org/'>link</a>"
|
||||
|
||||
scrubbed = SearchIndexer::HtmlScrubber.scrub(html)
|
||||
|
||||
expect(scrubbed).to eq(" http://meta.discourse.org/ link ")
|
||||
end
|
||||
|
||||
it 'correctly indexes a post according to version' do
|
||||
# Preparing so that they can be indexed to right version
|
||||
SearchIndexer.update_posts_index(post_id, "dummy", "", nil, nil)
|
||||
|
|
Loading…
Reference in New Issue
Block a user