Add 'sdk/java-v2/' from commit '55f103e336ca9fb8bf1720d2ef4ee8dd4e221118'
[arvados.git] / apps / workbench / config / initializers / redcloth.rb
index 4c242dea61d881dc85165a7f4900368b3f3c27be..e0d6ac4ce61363cd9fdc50eebfb2012794fb6dc8 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 module RedClothArvadosLinkExtension
 
   class RedClothViewBase < ActionView::Base
@@ -14,7 +18,8 @@ module RedClothArvadosLinkExtension
     text.gsub!(/"(?!\s)([^"]*\S)":(\S+)/) do
       text, link = $~[1..2]
       arvados_link = RedClothViewBase.new.helper_link_to_if_arvados_object(link, { :link_text => text })
-      arvados_link ? arvados_link : "#{text}:#{link}"
+      # if it's not an arvados_link the helper will return the link unprocessed and so we will reconstruct the textile link string so it can be processed normally
+      (arvados_link == link) ? "\"#{text}\":#{link}" : arvados_link
     end
   end
 end