mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: tag regexp (#253)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
var tagRegexp = regexp.MustCompile(`#([^\s#]+?) `)
|
var tagRegexp = regexp.MustCompile(`[^\s]?#([^\s#]+?) `)
|
||||||
|
|
||||||
func (s *Server) registerTagRoutes(g *echo.Group) {
|
func (s *Server) registerTagRoutes(g *echo.Group) {
|
||||||
g.GET("/tag", func(c echo.Context) error {
|
g.GET("/tag", func(c echo.Context) error {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
export const TAG_REG = /#([^\s#]+?) /;
|
export const TAG_REG = /[^\s]?#([^\s#]+?) /;
|
||||||
|
|
||||||
const match = (rawStr: string): number => {
|
const match = (rawStr: string): number => {
|
||||||
const matchResult = rawStr.match(TAG_REG);
|
const matchResult = rawStr.match(TAG_REG);
|
||||||
|
@@ -27,5 +27,5 @@ export { EMPHASIS_REG } from "./Emphasis";
|
|||||||
|
|
||||||
// The order determines the order of execution.
|
// The order determines the order of execution.
|
||||||
export const blockElementParserList = [CodeBlock, TodoList, DoneList, OrderedList, UnorderedList, Paragraph];
|
export const blockElementParserList = [CodeBlock, TodoList, DoneList, OrderedList, UnorderedList, Paragraph];
|
||||||
export const inlineElementParserList = [Image, Mark, Link, Bold, Emphasis, Tag, PlainLink];
|
export const inlineElementParserList = [Image, Mark, Link, Bold, Emphasis, PlainLink, Tag];
|
||||||
export const parserList = [...blockElementParserList, ...inlineElementParserList];
|
export const parserList = [...blockElementParserList, ...inlineElementParserList];
|
||||||
|
Reference in New Issue
Block a user