-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Parse tags starting with digits and containing spaces (close #1072)
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export const wikiLinkRegex = /(!?\[\[)([^\]\|]+)(?:\|([^\]]+))?(\]\])/g; // [fullMatch, firstMark, url, alias, lastMark] | ||
export const mdLinkRegex = /!?\[(?<title>[^\]]*)\]\((?<url>.+)\)/g; // [fullMatch, alias, url] | ||
export const tagRegex = | ||
/#[^\d\s!@#$%^&*(),.?":{}|<>\\][^\s!@#$%^&*(),.?":{}|<>\\]*/; | ||
/#(?:(?:\d*[^\d\s!@#$%^&*(),.?":{}|<>\\][^\s!@#$%^&*(),.?":{}|<>\\]*)|(?:"[^"\n]+")|(?:<[^>\n]+>))/; | ||
export const pWikiLinkRegex = new RegExp("^" + wikiLinkRegex.source); // Modified regex used only in parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#level/beginner | ||
|
||
These can be used in text to assign an [[Objects#tag]] #like-this. If hashtags are the only content of first paragraph, they are applied to the entire page. | ||
|
||
Hashtags can contain letters, dashes, underscores and other characters, but not: | ||
- Whitespace (space, newline etc.) | ||
- Characters from this list `!@#$%^&*(),.?":{}|<>\` | ||
- Consist of digits only #123 (but #3dprint is recognised) | ||
|
||
If you need your tags to contain these characters, you have to surround the tag content with either: | ||
- Double quotes `#"tag in quotes"` #“tag in quotes” | ||
- Angle brackets #<tag in angle> #<tag in angle> | ||
|
||
```query | ||
tag where page = @page.name | ||
``` |