Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
177a74e8
Commit
177a74e8
authored
Feb 11, 2026
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: allow ampersand in tags to support compound tags
parent
f7d370db
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
tag.go
plugin/markdown/parser/tag.go
+2
-1
tag_test.go
plugin/markdown/parser/tag_test.go
+6
-0
remark-tag.ts
web/src/utils/remark-plugins/remark-tag.ts
+1
-1
No files found.
plugin/markdown/parser/tag.go
View file @
177a74e8
...
...
@@ -51,7 +51,8 @@ func isValidTagRune(r rune) bool {
// Underscore: word separation (snake_case)
// Hyphen: word separation (kebab-case)
// Forward slash: hierarchical tags (category/subcategory)
if
r
==
'_'
||
r
==
'-'
||
r
==
'/'
{
// Ampersand: compound tags (science&tech)
if
r
==
'_'
||
r
==
'-'
||
r
==
'/'
||
r
==
'&'
{
return
true
}
...
...
plugin/markdown/parser/tag_test.go
View file @
177a74e8
...
...
@@ -30,6 +30,12 @@ func TestTagParser(t *testing.T) {
expectedTag
:
"work-notes"
,
shouldParse
:
true
,
},
{
name
:
"tag with ampersand"
,
input
:
"#science&tech"
,
expectedTag
:
"science&tech"
,
shouldParse
:
true
,
},
{
name
:
"tag with underscore"
,
input
:
"#2024_plans"
,
...
...
web/src/utils/remark-plugins/remark-tag.ts
View file @
177a74e8
...
...
@@ -18,7 +18,7 @@ function isTagChar(char: string): boolean {
return
true
;
}
return
char
===
"_"
||
char
===
"-"
||
char
===
"/"
;
return
char
===
"_"
||
char
===
"-"
||
char
===
"/"
||
char
===
"&"
;
}
function
parseTagsFromText
(
text
:
string
):
Array
<
{
type
:
"text"
;
value
:
string
}
|
{
type
:
"tag"
;
value
:
string
}
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment