I just posted a note where I had referenced number 100 as "#100". Of course that now renders as a hash tag. Does anyone have any existing code to filter out numeric values, or anything more intelligent? Thanks!
@CaptainStarbuck I believe there decision was to leave numeric hashtags due to flight numbers and such which people may want to tag as discussions. You can take a look at the issue here http://status.net/open-source/issues/745 - which included a patch for an old version of StatusNet to remove numbers from hash tags if you feel like adapting it for your implementation.
I tried adding that line after the call to common_replace_urls_callback, but text still comes back tagged. I even commented out all of those lines and a test status shows text is still processed. Is there some other function that processes that text?
I understand that mixing old and new code can be precarious but in this case it looks like I should be able to add the new line with no problem. If that's not the case, it will take a while to resolve and re-fit the current regex with the suggested regex for this function.
Comments
$r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r);
$r = common_replace_urls_callback($r, 'common_linkify');
$r = preg_replace('/(^|\"\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
The patch for issue 745 replaces an old version of that last line with the following:
$r = preg_replace('/(^|\(|\[|\s+)#(?![\d]+\s)([A-Za-z0-9_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
I tried adding that line after the call to common_replace_urls_callback, but text still comes back tagged. I even commented out all of those lines and a test status shows text is still processed. Is there some other function that processes that text?
I understand that mixing old and new code can be precarious but in this case it looks like I should be able to add the new line with no problem. If that's not the case, it will take a while to resolve and re-fit the current regex with the suggested regex for this function.
Any suggestions? Thanks @jordanc!