Allow ! after hashtags and mentions
This commit is contained in:
parent
4f64b2c615
commit
138c1e915e
3 changed files with 6 additions and 2 deletions
|
@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
- Disabled post tokenization (can be re-enabled with `ethereum-extras` feature).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Allow `!` after hashtags and mentions.
|
||||
|
||||
## [1.16.0] - 2023-03-08
|
||||
|
||||
### Added
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::errors::ValidationError;
|
|||
use super::links::is_inside_code_block;
|
||||
|
||||
const HASHTAG_RE: &str = r"(?m)(?P<before>^|\s|>|[\(])#(?P<tag>[^\s<]+)";
|
||||
const HASHTAG_SECONDARY_RE: &str = r"^(?P<tag>[0-9A-Za-z]+)(?P<after>[\.,:?\)]?)$";
|
||||
const HASHTAG_SECONDARY_RE: &str = r"^(?P<tag>[0-9A-Za-z]+)(?P<after>[\.,:?!\)]?)$";
|
||||
const HASHTAG_NAME_RE: &str = r"^\w+$";
|
||||
|
||||
/// Finds anything that looks like a hashtag
|
||||
|
|
|
@ -13,7 +13,7 @@ use super::links::is_inside_code_block;
|
|||
|
||||
// See also: ACTOR_ADDRESS_RE in webfinger::types
|
||||
const MENTION_SEARCH_RE: &str = r"(?m)(?P<before>^|\s|>|[\(])@(?P<mention>[^\s<]+)";
|
||||
const MENTION_SEARCH_SECONDARY_RE: &str = r"^(?P<username>[\w\.-]+)(@(?P<hostname>[\w\.-]+\w))?(?P<after>[\.,:?\)]?)$";
|
||||
const MENTION_SEARCH_SECONDARY_RE: &str = r"^(?P<username>[\w\.-]+)(@(?P<hostname>[\w\.-]+\w))?(?P<after>[\.,:?!\)]?)$";
|
||||
|
||||
/// Finds everything that looks like a mention
|
||||
fn find_mentions(
|
||||
|
|
Loading…
Reference in a new issue