mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Hashtags should work for non-english characters
This commit is contained in:
parent
5381096bfd
commit
2076f371b3
@ -44,7 +44,7 @@ function addHashtag(buffer, matches, state) {
|
|||||||
export function setup(helper) {
|
export function setup(helper) {
|
||||||
helper.registerPlugin(md => {
|
helper.registerPlugin(md => {
|
||||||
const rule = {
|
const rule = {
|
||||||
matcher: /#([\w-:]{1,101})/,
|
matcher: /#([\u00C0-\u1FFF\u2C00-\uD7FF\w-:]{1,101})/,
|
||||||
onMatch: addHashtag
|
onMatch: addHashtag
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -621,6 +621,12 @@ QUnit.test("Category hashtags", assert => {
|
|||||||
'<p><small><span class="hashtag">#category-hashtag</span></small></p>',
|
'<p><small><span class="hashtag">#category-hashtag</span></small></p>',
|
||||||
"it works between HTML tags"
|
"it works between HTML tags"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assert.cooked(
|
||||||
|
"Checkout #ụdị",
|
||||||
|
'<p>Checkout <span class="hashtag">#ụdị</span></p>',
|
||||||
|
"it works for non-english characters"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test("Heading", assert => {
|
QUnit.test("Heading", assert => {
|
||||||
|
Loading…
Reference in New Issue
Block a user