Or perhaps that should be an option. But it seems more natural to separate the term itself from the symbol being used to identify it. Patch attached works for me.

CommentFileSizeAuthor
hashtags-7.x-1.2_strip-hash_0.patch461 bytesHorsePunchKid

Comments

fadgadget’s picture

I would like to have that feature in the 6. version if possible at all. Be great. thanks

mastoll’s picture

Issue summary: View changes

I applied this patch to V. 7.x-1.4 by hand. I added the lines

  for ($i = 0; $i < count($result); $i++) {
    $result[$i] = preg_replace('/^#/', '', $result[$i]);
  }

right before "return $result;"

Only the first hashed term was stripped of its #-mark. How could I modify this to make it iterate through all the terms?

mastoll’s picture

I modified this patch for v. 7.x-1.4 such that hashtags in the body field convert to taxonomy tags without hash marks. i.e. "#my-tag" in the body text will create a "my-tag" taxonomy term. This term is added to the "hashtag" vocabulary.

I'm sorry, I don't know how to create a patch . . . here is the code that I inserted:

foreach ($tags_list[1] as $key => $tag) {
      $tags_list[1][$key] = preg_replace('/^#/', '', $tag); 
    }

inside the if {$capture_position) statement, right before

foreach ($tags_list[1] as $key => $tag) {
      $tags_list[1][$key] = preg_replace('/^#/', '', $tag); 
    }
Strutsagget’s picture

Feel like this should be default behaviour and then maybe a prefix or css that set # infront when needed.

radamiel’s picture

Version: 7.x-1.2 » 7.x-1.5
Status: Needs review » Fixed
radamiel’s picture

Version: 7.x-1.5 » 7.x-1.4
radamiel’s picture

fixed in 7.x-1.5 version - update.php must be run

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.