mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update tag regexp (#785)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
var tagRegexpList = []*regexp.Regexp{regexp.MustCompile(`^#([^\s#]+?) `), regexp.MustCompile(`[^\S]#([^\s#]+?) `), regexp.MustCompile(` #([^\s#]+?) `)}
|
var tagRegexpList = []*regexp.Regexp{regexp.MustCompile(`^#([^\s#]+?) `), regexp.MustCompile(`^#([^\s#]+?)\s`), regexp.MustCompile(`[^\S]#([^\s#]+?)$`), regexp.MustCompile(`[^\S]#([^\s#]+?) `), regexp.MustCompile(` #([^\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,6 +1,6 @@
|
|||||||
import { escape } from "lodash-es";
|
import { escape } from "lodash-es";
|
||||||
|
|
||||||
export const TAG_REG = /#([^\s#]+?) /;
|
export const TAG_REG = /#([^\s#]+)/;
|
||||||
|
|
||||||
const renderer = (rawStr: string): string => {
|
const renderer = (rawStr: string): string => {
|
||||||
const matchResult = rawStr.match(TAG_REG);
|
const matchResult = rawStr.match(TAG_REG);
|
||||||
|
Reference in New Issue
Block a user