mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Allow dashes and undescores in hashtags
This commit is contained in:
parent
cc5d5de285
commit
ca79d824cc
@ -40,7 +40,7 @@ import { hookForDev } from '../../lib/devTools';
|
||||
import { getMediaUrl as getMediaUrlDefault } from "../../lib/media";
|
||||
import NoteImage from '../NoteImage/NoteImage';
|
||||
import { createStore, unwrap } from 'solid-js/store';
|
||||
import { linebreakRegex, shortMentionInWords, shortNoteWords, specialCharsRegex, urlExtractRegex } from '../../constants';
|
||||
import { hashtagCharsRegex, linebreakRegex, shortMentionInWords, shortNoteWords, specialCharsRegex, urlExtractRegex } from '../../constants';
|
||||
import { useIntl } from '@cookbook/solid-intl';
|
||||
import { actions } from '../../translations';
|
||||
|
||||
@ -991,7 +991,7 @@ const ParsedNote: Component<{
|
||||
let [_, term] = token.split('#');
|
||||
let end = '';
|
||||
|
||||
let match = specialCharsRegex.exec(term);
|
||||
let match = hashtagCharsRegex.exec(term);
|
||||
|
||||
if (match) {
|
||||
const i = match.index;
|
||||
|
@ -262,6 +262,7 @@ export const profileRegexG = /nostr:((npub|nprofile)1\w+)\b/g;
|
||||
export const editMentionRegex = /(?:\s|^)@\`(.*?)\`/ig;
|
||||
|
||||
export const specialCharsRegex = /[^A-Za-z0-9]/;
|
||||
export const hashtagCharsRegex = /[^A-Za-z0-9\-\_]/;
|
||||
|
||||
// How long, in words, should a short note be
|
||||
export const shortNoteWords = 200;
|
||||
|
Loading…
Reference in New Issue
Block a user