remove autolink
This commit is contained in:
@@ -33,7 +33,6 @@ gem 'pretender'
|
|||||||
gem 'puma', require: false
|
gem 'puma', require: false
|
||||||
gem 'rack'
|
gem 'rack'
|
||||||
gem 'rails'
|
gem 'rails'
|
||||||
gem 'rails_autolink'
|
|
||||||
gem 'rails-i18n'
|
gem 'rails-i18n'
|
||||||
gem 'rotp'
|
gem 'rotp'
|
||||||
gem 'rouge', require: false
|
gem 'rouge', require: false
|
||||||
|
|||||||
@@ -219,7 +219,6 @@ GEM
|
|||||||
concurrent-ruby (~> 1.1)
|
concurrent-ruby (~> 1.1)
|
||||||
webrick (~> 1.7)
|
webrick (~> 1.7)
|
||||||
websocket-driver (~> 0.7)
|
websocket-driver (~> 0.7)
|
||||||
ffi (1.17.3)
|
|
||||||
ffi (1.17.3-aarch64-linux-gnu)
|
ffi (1.17.3-aarch64-linux-gnu)
|
||||||
ffi (1.17.3-aarch64-linux-musl)
|
ffi (1.17.3-aarch64-linux-musl)
|
||||||
ffi (1.17.3-arm64-darwin)
|
ffi (1.17.3-arm64-darwin)
|
||||||
@@ -352,8 +351,6 @@ GEM
|
|||||||
oj (3.16.13)
|
oj (3.16.13)
|
||||||
bigdecimal (>= 3.0)
|
bigdecimal (>= 3.0)
|
||||||
ostruct (>= 0.2)
|
ostruct (>= 0.2)
|
||||||
onnxruntime (0.10.1)
|
|
||||||
ffi
|
|
||||||
onnxruntime (0.10.1-aarch64-linux)
|
onnxruntime (0.10.1-aarch64-linux)
|
||||||
ffi
|
ffi
|
||||||
onnxruntime (0.10.1-arm64-darwin)
|
onnxruntime (0.10.1-arm64-darwin)
|
||||||
@@ -372,7 +369,6 @@ GEM
|
|||||||
parser (3.3.10.1)
|
parser (3.3.10.1)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
pg (1.6.3)
|
|
||||||
pg (1.6.3-aarch64-linux)
|
pg (1.6.3-aarch64-linux)
|
||||||
pg (1.6.3-aarch64-linux-musl)
|
pg (1.6.3-aarch64-linux-musl)
|
||||||
pg (1.6.3-arm64-darwin)
|
pg (1.6.3-arm64-darwin)
|
||||||
@@ -439,10 +435,6 @@ GEM
|
|||||||
rails-i18n (8.1.0)
|
rails-i18n (8.1.0)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 8.0.0, < 9)
|
railties (>= 8.0.0, < 9)
|
||||||
rails_autolink (1.1.8)
|
|
||||||
actionview (> 3.1)
|
|
||||||
activesupport (> 3.1)
|
|
||||||
railties (> 3.1)
|
|
||||||
railties (8.1.2)
|
railties (8.1.2)
|
||||||
actionpack (= 8.1.2)
|
actionpack (= 8.1.2)
|
||||||
activesupport (= 8.1.2)
|
activesupport (= 8.1.2)
|
||||||
@@ -662,7 +654,6 @@ DEPENDENCIES
|
|||||||
rack
|
rack
|
||||||
rails
|
rails
|
||||||
rails-i18n
|
rails-i18n
|
||||||
rails_autolink
|
|
||||||
rotp
|
rotp
|
||||||
rouge
|
rouge
|
||||||
rqrcode
|
rqrcode
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<% if configs = account.account_configs.find_by(key: AccountConfig::POLICY_LINKS_KEY) %>
|
<% if configs = account.account_configs.find_by(key: AccountConfig::POLICY_LINKS_KEY) %>
|
||||||
<div class="max-w-md mx-auto flex flex-wrap gap-1 justify-center text-sm text-base-content/60 mt-2">
|
<div class="max-w-md mx-auto flex flex-wrap gap-1 justify-center text-sm text-base-content/60 mt-2">
|
||||||
<%= auto_link(MarkdownToHtml.call(configs.value)) %>
|
<%= MarkdownToHtml.call(configs.value) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<% if @form_configs[:policy_links].present? %>
|
<% if @form_configs[:policy_links].present? %>
|
||||||
<div class="text-center md:text-neutral-500 md:pr-3 md:pb-3 md:text-sm md:text-left mt-2 md:mt-0 md:fixed md:bottom-0 md:right-0">
|
<div class="text-center md:text-neutral-500 md:pr-3 md:pb-3 md:text-sm md:text-left mt-2 md:mt-0 md:fixed md:bottom-0 md:right-0">
|
||||||
<div class="md:max-w-[8rem] flex flex-wrap md:flex-col justify-center md:justify-start md:items-start space-x-2 md:space-x-0">
|
<div class="md:max-w-[8rem] flex flex-wrap md:flex-col justify-center md:justify-start md:items-start space-x-2 md:space-x-0">
|
||||||
<%= auto_link(MarkdownToHtml.call(@form_configs[:policy_links])) %>
|
<%= MarkdownToHtml.call(@form_configs[:policy_links]) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= auto_link(simple_format(MarkdownToHtml.call(h(ReplaceEmailVariables.call(local_assigns[:content], submitter: local_assigns[:submitter], sig: local_assigns[:sig]))))) %>
|
<%= MarkdownToHtml.call(ReplaceEmailVariables.call(local_assigns[:content], submitter: local_assigns[:submitter], sig: local_assigns[:sig])) %>
|
||||||
|
|||||||
@@ -27,11 +27,13 @@ module MarkdownToHtml
|
|||||||
link_parts = text.split(%r{((?:https?://|www\.)[^\s)]+)})
|
link_parts = text.split(%r{((?:https?://|www\.)[^\s)]+)})
|
||||||
|
|
||||||
link_parts.map.with_index do |part, index|
|
link_parts.map.with_index do |part, index|
|
||||||
if part.match?(%r{\A(?:https?://|www\.)}) &&
|
if part.match?(%r{\A(?:https?://|www\.)}) && !(index > 0 && link_parts[index - 1]&.match?(/\]\(\s*\z/))
|
||||||
!(index > 0 && link_parts[index - 1]&.match?(/\]\(\s*\z/))
|
|
||||||
trail = part.match(/([.,;:!?]+)\z/)[1] if part.match?(/[.,;:!?]+\z/)
|
trail = part.match(/([.,;:!?]+)\z/)[1] if part.match?(/[.,;:!?]+\z/)
|
||||||
|
|
||||||
clean = trail ? part.chomp(trail) : part
|
clean = trail ? part.chomp(trail) : part
|
||||||
url = clean.start_with?('www.') ? "http://#{clean}" : clean
|
|
||||||
|
url = clean.start_with?('www.') ? "https://#{clean}" : clean
|
||||||
|
|
||||||
"[#{clean}](#{url})#{trail}"
|
"[#{clean}](#{url})#{trail}"
|
||||||
else
|
else
|
||||||
part
|
part
|
||||||
|
|||||||
Reference in New Issue
Block a user