diff --git a/base-theme/layouts/partials/external_resource_link.html b/base-theme/layouts/partials/external_resource_link.html index da634d9e2..7497f89be 100644 --- a/base-theme/layouts/partials/external_resource_link.html +++ b/base-theme/layouts/partials/external_resource_link.html @@ -1,4 +1,4 @@ -{{- $text := default .title .text | htmlEscape | page.RenderString -}} +{{- $text := default .title .text -}} {{- $href := default "" .external_url -}} {{- $isBroken := default false .is_broken -}} {{- $backupUrl := default "" .backup_url -}} diff --git a/base-theme/layouts/shortcodes/resource_link.html b/base-theme/layouts/shortcodes/resource_link.html index a07957158..1698ca18c 100644 --- a/base-theme/layouts/shortcodes/resource_link.html +++ b/base-theme/layouts/shortcodes/resource_link.html @@ -2,7 +2,10 @@ {{- $title := index .Params 1 | safeHTML -}} {{- $anchor_id := index .Params 2 | default ""}} {{- range where $.Site.Pages "Params.uid" $uuid -}} -{{- if eq .Params.content_type "external-resource" -}} + {{- if eq .Params.content_type "external-resource" -}} + {{- if findRE "^(?:http|https|ftp|mailto)" $title -}} + {{- $title = (replace $title "/" "\\/") -}} + {{- end -}} {{- partial "external_resource_link" (merge .Params (dict "text" $title)) -}} diff --git a/course-v2/layouts/partials/course_description.html b/course-v2/layouts/partials/course_description.html index 59ff5a24e..e439c574a 100644 --- a/course-v2/layouts/partials/course_description.html +++ b/course-v2/layouts/partials/course_description.html @@ -9,7 +9,7 @@