mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
DEV: Remove enable_experimental_hashtag_autocomplete logic (#22820)
This commit removes any logic in the app and in specs around enable_experimental_hashtag_autocomplete and deletes some old category hashtag code that is no longer necessary. It also adds a `slug_ref` category instance method, which will generate a reference like `parent:child` for a category, with an optional depth, which hashtags use. Also refactors PostRevisor which was using CategoryHashtagDataSource directly which is a no-no. Deletes the old hashtag markdown rule as well.
This commit is contained in:
@ -5,9 +5,6 @@ RSpec.describe "CommonMark" do
|
||||
SiteSetting.enable_markdown_typographer = false
|
||||
SiteSetting.highlighted_languages = "ruby|aa"
|
||||
|
||||
# TODO (martin) Remove when enable_experimental_hashtag_autocomplete is default for all sites
|
||||
SiteSetting.enable_experimental_hashtag_autocomplete = false
|
||||
|
||||
html, state, md = nil
|
||||
failed = 0
|
||||
|
||||
@ -34,7 +31,7 @@ RSpec.describe "CommonMark" do
|
||||
cooked = PrettyText.markdown(md, sanitize: false)
|
||||
cooked.strip!
|
||||
cooked.gsub!(" class=\"lang-auto\"", "")
|
||||
cooked.gsub!(%r{<span class="hashtag">(.*)</span>}, "\\1")
|
||||
cooked.gsub!(%r{<span class="hashtag-raw">(.*)</span>}, "\\1")
|
||||
cooked.gsub!(%r{<a name="(.*)" class="anchor" href="#\1*"></a>}, "")
|
||||
# we support data-attributes which is not in the spec
|
||||
cooked.gsub!("<pre data-code-startline=\"3\">", "<pre>")
|
||||
|
Reference in New Issue
Block a user