Render htmlentities correctly for links not supported by Rinku
What does this MR do?
It fixes the links of protocols not supported by Rinku that contain htmlentities.
Are there points in the code the reviewer needs to double check?
There is a problem with Rinku
The original fix fixes the links not supported by Rinku. Example:
<rdar://link><another>
extracts
#(Element:0x3ffa4e968808 {
name = "a",
attributes = [ #(Attr:0x3ffa4e9687cc { name = "href", value = "rdar://link" })],
children = [ #(Text "rdar://link")]
})
as the a
element. This is done by https://gitlab.com/gitlab-org/gitlab-ce/blob/60d0568f8515c3ff18d693329087fe0f30ac9611/lib/banzai/filter/autolink_filter.rb#L120
However for http links this method is not entered because everything is done automatically by Rinku in https://gitlab.com/gitlab-org/gitlab-ce/blob/60d0568f8515c3ff18d693329087fe0f30ac9611/lib/banzai/filter/autolink_filter.rb#L65 . This results into a
element generated differently:
<http://link><another>
extracts
#(Element:0x3fdccbe6c890 {
name = "a",
attributes = [ #(Attr:0x3fdccbe6c868 { name = "href", value = "http://link><another" })],
children = [ #(Text "http://link><another")]
})
Why was this MR needed?
As described in the related issue using protocols not supported by Rinku (eg. rdar) caused not correct titles. Example given the title <rdar://31766613><°)))><
the title became <rdar://31766613><°)))><
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #41719 (closed)