diff --git a/includes/class-hashtag.php b/includes/class-hashtag.php index 1a76577..d9006c1 100644 --- a/includes/class-hashtag.php +++ b/includes/class-hashtag.php @@ -89,7 +89,7 @@ class Hashtag { if ( $tag_object ) { $link = \get_term_link( $tag_object, 'post_tag' ); - return \sprintf( '', $link, $tag ); + return \sprintf( '', $link, $tag ); } return '#' . $tag; diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index d1c71f5..d985f3e 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -359,7 +359,7 @@ class Shortcodes { foreach ( $categories as $category ) { $hash_tags[] = \sprintf( - '', + '', \esc_url( \get_category_link( $category ) ), esc_hashtag( $category->name ) ); diff --git a/tests/test-class-activitypub-hashtag.php b/tests/test-class-activitypub-hashtag.php index 51a532c..8a79c12 100644 --- a/tests/test-class-activitypub-hashtag.php +++ b/tests/test-class-activitypub-hashtag.php @@ -35,12 +35,12 @@ ENDPRE; array( 'test', 'test' ), array( '#test', '#test' ), array( 'hallo #test test', 'hallo #test test' ), - array( 'hallo #object test', 'hallo test' ), - array( '#object test', ' test' ), + array( 'hallo #object test', 'hallo test' ), + array( '#object test', ' test' ), array( 'hallo test test', 'hallo test test' ), array( 'hallo #test test', 'hallo #test test' ), - array( '
hallo #object test
', '
hallo test
' ), - array( '
hallo #object
', '
hallo
' ), + array( '
hallo #object test
', '
hallo test
' ), + array( '
hallo #object
', '
hallo
' ), array( '
#object
', '
#object
' ), array( '#object', '#object' ), array( '
object', '
object' ),