From eea88e8022d3fd3c46401e1a297ebd7318c3c7b1 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Thu, 14 Sep 2023 14:02:15 +0200 Subject: send/digest fixed --- create.rb | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'create.rb') diff --git a/create.rb b/create.rb index 9241d2b..8e221c8 100644 --- a/create.rb +++ b/create.rb @@ -38,16 +38,10 @@ post '/create' do 'mediaType' => media_type(url), 'url' => url } - when '' - content << '

' 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 - "#{word}" - when URI::MailTo::EMAIL_REGEXP - "#{word}" 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 } - "#{word}" - when MENTION_REGEXP + when MENTION_REGEXP actor = actor(word) tag << { 'type' => 'Mention', 'href' => actor, 'name' => word } - "#{word}" - else - word end end + content << line end end -- cgit v1.2.3