mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 07:35:14 +00:00
ignore bbcode open tag (left bracket) in hash and mention tag regexes and turn it into a tag delimiter
This commit is contained in:
parent
7a24943c34
commit
d6ae124bbd
1 changed files with 2 additions and 2 deletions
|
@ -620,7 +620,7 @@ function get_tags($s) {
|
||||||
// Match full names against @tags including the space between first and last
|
// Match full names against @tags including the space between first and last
|
||||||
// We will look these up afterward to see if they are full names or not recognisable.
|
// We will look these up afterward to see if they are full names or not recognisable.
|
||||||
|
|
||||||
if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) {
|
if(preg_match_all('/(@[^ \x0D\x0A,:?\[]+ [^ \x0D\x0A@,:?\[]+)([ \x0D\x0A@,:?\[]|$)/',$s,$match)) {
|
||||||
foreach($match[1] as $mtch) {
|
foreach($match[1] as $mtch) {
|
||||||
if(strstr($mtch,"]")) {
|
if(strstr($mtch,"]")) {
|
||||||
// we might be inside a bbcode color tag - leave it alone
|
// we might be inside a bbcode color tag - leave it alone
|
||||||
|
@ -636,7 +636,7 @@ function get_tags($s) {
|
||||||
// Otherwise pull out single word tags. These can be @nickname, @first_last
|
// Otherwise pull out single word tags. These can be @nickname, @first_last
|
||||||
// and #hash tags.
|
// and #hash tags.
|
||||||
|
|
||||||
if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) {
|
if(preg_match_all('/([@#][^ \x0D\x0A,;:?\[]+)([ \x0D\x0A,;:?\[]|$)/',$s,$match)) {
|
||||||
foreach($match[1] as $mtch) {
|
foreach($match[1] as $mtch) {
|
||||||
if(strstr($mtch,"]")) {
|
if(strstr($mtch,"]")) {
|
||||||
// we might be inside a bbcode color tag - leave it alone
|
// we might be inside a bbcode color tag - leave it alone
|
||||||
|
|
Loading…
Reference in a new issue