PERF: Replace video and audio links in search blurb while indexing.

In the near future, we will be swtiching to PG headlines to generate the
search blurb. As such, we need to replace audio and video links in the
raw data used for headline generation. This also means that we avoid
replacing links each time we need to generate the blurb.
This commit is contained in:
Guo Xiang Tan
2020-08-06 12:25:03 +08:00
parent 06ef87da51
commit 255b0e9f14
6 changed files with 68 additions and 22 deletions

View File

@ -24,6 +24,8 @@ module Discourse
end
class Utils
URI_REGEXP = URI.regexp(%w{http https})
# Usage:
# Discourse::Utils.execute_command("pwd", chdir: 'mydirectory')
# or with a block