Slogger
Slogger copied to clipboard
Multi-word tags
I'm attempting to author my own plugin and noticed it was setup to only allow single word tags, which interferes with my desires. Day One seems to allow multi-word tags, so was that intentional?
Cheapest fix seems to be slip \s into the content.scan in dayone.rb, but my ruby knowledge is new and the resulting string needs a bit of a trim.
Thought I'd check for guidance before blundering off in my own direction.
Okay, here is my suggestion — allows for multiword and if you're using markdown in your source, you won't get tripped up, but plugins will optionally need to pass tags differently:
ln 18 of dayone.rb
tags = options['tags'] || tags = content.scan(/#([A-Za-z0-9]+)/m).map { |tag| tag[0].strip }.delete_if {|tag| tag =~ /^\d+$/ }.uniq.sort