mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: support links in tag descriptions (#22994)
* scrub non-a html tags from tag descriptions on create, strips all tags from tag description when displayed in tag hover * test for tag description links * UX: basic render-tag test * UX: fix linting * UX: fix linting * fix broken tests * Update spec/models/tag_spec.rb Co-authored-by: Penar Musaraj <pmusaraj@gmail.com> * UX: use has_sanitizable_fields instead of has_scrubbable_fields to ensafen tag.description --------- Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This commit is contained in:
@@ -54,7 +54,7 @@ describe "Viewing sidebar as anonymous user", type: :system do
|
||||
expect(sidebar).to have_tags_section
|
||||
expect(sidebar).to have_all_tags_section_link
|
||||
expect(sidebar).to have_tag_section_links([tag3, tag2, tag4, tag5, tag1])
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description <script>")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description ")
|
||||
end
|
||||
|
||||
it "should display the site's top tags when `default_navigation_menu_tags` site setting has been set but the tags configured are hidden to the user" do
|
||||
@@ -66,7 +66,7 @@ describe "Viewing sidebar as anonymous user", type: :system do
|
||||
expect(sidebar).to have_tags_section
|
||||
expect(sidebar).to have_all_tags_section_link
|
||||
expect(sidebar).to have_tag_section_links([tag3, tag2, tag4, tag1, tag6])
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description <script>")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description ")
|
||||
end
|
||||
|
||||
it "should display the tags configured in `default_navigation_menu_tags` site setting when it has been set" do
|
||||
|
||||
@@ -162,7 +162,7 @@ describe "Viewing sidebar as logged in user", type: :system do
|
||||
expect(sidebar).to have_tags_section
|
||||
expect(sidebar).to have_tag_section_links([tag3, tag2, tag4, tag5, tag1])
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag3, "tag 3 description")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description <script>")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description ")
|
||||
expect(sidebar).to have_all_tags_section_link
|
||||
end
|
||||
|
||||
@@ -177,7 +177,7 @@ describe "Viewing sidebar as logged in user", type: :system do
|
||||
expect(sidebar).to have_tags_section
|
||||
expect(sidebar).to have_tag_section_links([tag1, tag2, tag3])
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag3, "tag 3 description")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description <script>")
|
||||
expect(sidebar).to have_tag_section_link_with_title(tag1, "tag 1 description ")
|
||||
expect(sidebar).to have_all_tags_section_link
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user