summaryrefslogtreecommitdiff
path: root/create.rb
diff options
context:
space:
mode:
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('#', ''))