Slogger icon indicating copy to clipboard operation
Slogger copied to clipboard

Multi-word tags

Open coopermj opened this issue 11 years ago • 1 comments

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.

coopermj avatar Mar 27 '14 15:03 coopermj

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

coopermj avatar Mar 28 '14 09:03 coopermj