diff options
author | pdp8 <pdp8@pdp8.info> | 2023-09-14 14:02:15 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-09-14 14:02:15 +0200 |
commit | eea88e8022d3fd3c46401e1a297ebd7318c3c7b1 (patch) | |
tree | 72a6ea1a1f07cbe13abd3eca2ece7b19a248a610 /create.rb | |
parent | d635057cb576c5570c5ceba5945cc5339b0f41ab (diff) |
send/digest fixed
Diffstat (limited to 'create.rb')
-rw-r--r-- | create.rb | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -38,16 +38,10 @@ post '/create' do 'mediaType' => media_type(url), 'url' => url } - when '' - content << '<p>' else # create links # single quotes in html invalidate digest, reason unknown - content << line.split(/\s+/).collect do |word| + line.split(/\s+/).each do |word| case word - when URL_REGEXP - "<a href=\"#{word}\">#{word}</a>" - when URI::MailTo::EMAIL_REGEXP - "<a href=\"mailto:#{word}\">#{word}</a>" when HASHTAG_REGEXP tag_url = File.join('https://social.pdp8.info', 'tags', word.sub('#', '')) tag << { @@ -55,19 +49,16 @@ post '/create' do 'href' => tag_url, 'name' => word } - "<a href=\"#{tag_url}\">#{word}</a>" - when MENTION_REGEXP + when MENTION_REGEXP actor = actor(word) tag << { 'type' => 'Mention', 'href' => actor, 'name' => word } - "<a href=\"#{actor}\">#{word}</a>" - else - word end end + content << line end end |