Skip to content

Render htmlentities correctly for links not supported by Rinku

Jarka Košanová requested to merge 41719-mr-title-fix into master

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&gt;&lt;°)))><

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #41719 (closed)

Edited by Jarka Košanová

Merge request reports