Fix hashtags preceded by non-break spaces not being processed as such (#38212)

This commit is contained in:
Claire
2026-03-16 10:39:18 +01:00
committed by GitHub
parent c993daa347
commit 5521aac4ab
2 changed files with 5 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ class Tag < ApplicationRecord
HASHTAG_LAST_SEQUENCE = '([[:word:]_]*[[:alpha:]][[:word:]_]*)'
HASHTAG_NAME_PAT = "#{HASHTAG_FIRST_SEQUENCE}|#{HASHTAG_LAST_SEQUENCE}".freeze
HASHTAG_RE = /(?<=^|\s)[#](#{HASHTAG_NAME_PAT})/
HASHTAG_RE = /(?<=^|[[:space:]])[#](#{HASHTAG_NAME_PAT})/
HASHTAG_NAME_RE = /\A(#{HASHTAG_NAME_PAT})\z/i
HASHTAG_INVALID_CHARS_RE = /[^[:alnum:]\u0E47-\u0E4E#{HASHTAG_SEPARATORS}]/