chore: update tag regexp (#785)

This commit is contained in:
boojack 2022-12-20 09:44:41 +08:00 committed by GitHub
parent b704c20809
commit c177db69d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import (
"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) {
g.GET("/tag", func(c echo.Context) error {

View File

@ -1,6 +1,6 @@
import { escape } from "lodash-es";
export const TAG_REG = /#([^\s#]+?) /;
export const TAG_REG = /#([^\s#]+)/;
const renderer = (rawStr: string): string => {
const matchResult = rawStr.match(TAG_REG);