diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-30 01:27:51 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-30 01:27:51 +0200 |
commit | 25bdc789215c728e6fac04404adcf1f8e4bcdd78 (patch) | |
tree | fabf21feea41ef2cedcca5f69480ee39c652b114 /create.rb | |
parent | c50f749a2685a3e7608cec8730f5fe79de4676ac (diff) |
html links for outbox notes
Diffstat (limited to 'create.rb')
-rw-r--r-- | create.rb | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -40,6 +40,9 @@ post '/create' do # TODO } end break + elsif line.match(url_regexp) + # single quotes in html invalidate digest, reason unknown + content << line.gsub(Regexp.last_match(0), "<a href=\"#{Regexp.last_match(0)}\">#{Regexp.last_match(0)}</a>") else tags = line.split(/\s+/).grep(hashtag_regexp) tags.each do |name| @@ -49,6 +52,8 @@ post '/create' do # TODO 'href' => tag_url, 'name' => name } + # single quotes in html invalidate digest, reason unknown + line.gsub!(name, "<a href=\"#{tag_url}\">#{name}</a>") end mentions = line.split(/\s+/).grep(mention_regexp) mentions.each do |mention| @@ -58,6 +63,8 @@ post '/create' do # TODO 'href' => actor, 'name' => mention } + # single quotes in html invalidate digest, reason unknown + line.gsub!(mention, "<a href=\"#{actor}\">#{mention}</a>") end content << line end |