summaryrefslogtreecommitdiff
path: root/create.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-09-24 12:28:40 +0200
committerpdp8 <pdp8@pdp8.info>2023-09-24 12:28:40 +0200
commit6100f9971b74ee4d3449155beb881a69017a296d (patch)
treebd2511b705847add76ea952ab6dd17aa1c0068c6 /create.rb
parent4dabdfb47154014f491462b026882102b5e668e3 (diff)
undo reactivated, object names without published date, find_object helper
Diffstat (limited to 'create.rb')
-rw-r--r--create.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/create.rb b/create.rb
index 0798ba1..dc1daab 100644
--- a/create.rb
+++ b/create.rb
@@ -37,15 +37,17 @@ post '/create' do
when REPLY_REGEXP
inReplyTo = line.sub(REPLY_REGEXP, '')
when ATTACH_REGEXP
- url = line.sub(ATTACH_REGEXP, '')
+ url, description = line.sub(ATTACH_REGEXP, '').split(/\s+/, 2)
attachment << {
'type' => 'Document',
'mediaType' => media_type(url),
- 'url' => url
+ 'url' => url,
+ 'name' => description
}
else # create links
# single quotes in html invalidate digest, reason unknown
line.split(/\s+/).each do |word|
+ word = word.gsub('<p>', '').gsub('</p>', '')
case word
when HASHTAG_REGEXP
tag_url = File.join('https://social.pdp8.info', 'tags', word.sub('#', ''))