From 17d4feaf15b2f763654003772c0a9680881b93b7 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 18 Feb 2017 03:06:28 -0600 Subject: [PATCH] dmail_notice.html.erb: use absolute urls in dtext links. --- app/helpers/application_helper.rb | 6 +++--- app/views/user_mailer/dmail_notice.html.erb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0e2c05446..6cdbcc477 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,9 +49,9 @@ module ApplicationHelper raw %{#{text}} end - def format_text(text, options = {}) - if options[:ragel] - raw(DTextRagel.parse(text)) + def format_text(text, ragel: true, **options) + if ragel + raw DTextRagel.parse(text, **options) else DText.parse(text) end diff --git a/app/views/user_mailer/dmail_notice.html.erb b/app/views/user_mailer/dmail_notice.html.erb index fce085ff2..2256b87ef 100644 --- a/app/views/user_mailer/dmail_notice.html.erb +++ b/app/views/user_mailer/dmail_notice.html.erb @@ -1,10 +1,10 @@ -

<%= h @dmail.from.name %> said:

+

<%= @dmail.from.name %> said:

-
- <%= DText.parse(@dmail.body) %> +
+ <%= format_text(@dmail.body, base_url: root_url) %>

<%= link_to "View message", dmail_url(@dmail, :host => Danbooru.config.hostname, :only_path => false) %> | <%= link_to "Unsubscribe", maintenance_user_email_notification_url(:user_id => @dmail.owner.id, :sig => email_sig(@dmail.owner), :host => Danbooru.config.hostname, :only_path => false) %>