From 775525a74e2242199ff673eb511c54d37241d17f Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 7 Apr 2018 22:02:47 -0400 Subject: [PATCH] Linkify the links --- modules/ui/success.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/ui/success.js b/modules/ui/success.js index 38d31be2d..98ae60806 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -41,11 +41,11 @@ export function uiSuccess(context) { summary .append('h3') - .html(t('success.thank_you' + (_location ? '_location' : ''), { where: _location })); + .text(t('success.thank_you' + (_location ? '_location' : ''), { where: _location })); summary .append('p') - .html(t('success.help_html')) + .text(t('success.help_html')) .append('a') .attr('class', 'details') .attr('target', '_blank') @@ -150,7 +150,7 @@ export function uiSuccess(context) { communityLinks .append('h3') - .html(t('success.like_osm')); + .text(t('success.like_osm')); var table = communityLinks .append('table') @@ -181,8 +181,8 @@ export function uiSuccess(context) { communityDetail.each(function(d) { var selection = d3_select(this); var replacements = { - url: d.url, - signupUrl: d.signupUrl || d.url + url: linkify(d.url), + signupUrl: linkify(d.signupUrl || d.url) }; selection @@ -196,13 +196,17 @@ export function uiSuccess(context) { selection .append('div') .attr('class', 'community-detail-description') - .text(t('community.' + d.id + '.description', replacements)); + .html(t('community.' + d.id + '.description', replacements)); if (d.extendedDescription) { selection .append('div') .attr('class', 'community-detail-extendedDescription') - .text(t('community.' + d.id + '.extendedDescription', replacements)); + .html(t('community.' + d.id + '.extendedDescription', replacements)); + } + + function linkify(url) { + return '' + url + ''; } }); }