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
5bb4a300
Commit
5bb4a300
authored
Feb 27, 2025
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: bump gomark
parent
012405f7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
158 deletions
+165
-158
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-0
markdown_service.proto
proto/api/v1/markdown_service.proto
+1
-1
markdown_service.pb.go
proto/gen/api/v1/markdown_service.pb.go
+147
-144
apidocs.swagger.yaml
proto/gen/apidocs.swagger.yaml
+5
-2
markdown_service.go
server/router/api/v1/markdown_service.go
+4
-6
Link.tsx
web/src/components/MemoContent/Link.tsx
+5
-4
No files found.
go.mod
View file @
5bb4a300
...
...
@@ -23,7 +23,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
github.com/usememos/gomark v0.0.0-202
40928134159-9aca881d9121
github.com/usememos/gomark v0.0.0-202
50227070400-97a73c2adb29
golang.org/x/crypto v0.32.0
golang.org/x/mod v0.22.0
golang.org/x/net v0.34.0
...
...
go.sum
View file @
5bb4a300
...
...
@@ -445,6 +445,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/usememos/gomark v0.0.0-20240928134159-9aca881d9121 h1:STlpvb/8zoZQVkigIV8bmDqPqzTkw/ZdM0kxn11N9wA=
github.com/usememos/gomark v0.0.0-20240928134159-9aca881d9121/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA=
github.com/usememos/gomark v0.0.0-20250227070400-97a73c2adb29 h1:wplHQ7AhCbYYT+Nt/OQcuEbW0P1Ht2KWYt/H3Ev8hsI=
github.com/usememos/gomark v0.0.0-20250227070400-97a73c2adb29/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
...
...
proto/api/v1/markdown_service.proto
View file @
5bb4a300
...
...
@@ -251,7 +251,7 @@ message ImageNode {
}
message
LinkNode
{
string
tex
t
=
1
;
repeated
Node
conten
t
=
1
;
string
url
=
2
;
}
...
...
proto/gen/api/v1/markdown_service.pb.go
View file @
5bb4a300
This diff is collapsed.
Click to expand it.
proto/gen/apidocs.swagger.yaml
View file @
5bb4a300
...
...
@@ -2715,8 +2715,11 @@ definitions:
v1LinkNode
:
type
:
object
properties
:
text
:
type
:
string
content
:
type
:
array
items
:
type
:
object
$ref
:
'
#/definitions/v1Node'
url
:
type
:
string
v1ListAllUserStatsResponse
:
...
...
server/router/api/v1/markdown_service.go
View file @
5bb4a300
...
...
@@ -96,8 +96,7 @@ func convertFromASTNode(rawNode ast.Node) *v1pb.Node {
case
*
ast
.
Text
:
node
.
Node
=
&
v1pb
.
Node_TextNode
{
TextNode
:
&
v1pb
.
TextNode
{
Content
:
n
.
Content
}}
case
*
ast
.
Bold
:
children
:=
convertFromASTNodes
(
n
.
Children
)
node
.
Node
=
&
v1pb
.
Node_BoldNode
{
BoldNode
:
&
v1pb
.
BoldNode
{
Symbol
:
n
.
Symbol
,
Children
:
children
}}
node
.
Node
=
&
v1pb
.
Node_BoldNode
{
BoldNode
:
&
v1pb
.
BoldNode
{
Symbol
:
n
.
Symbol
,
Children
:
convertFromASTNodes
(
n
.
Children
)}}
case
*
ast
.
Italic
:
node
.
Node
=
&
v1pb
.
Node_ItalicNode
{
ItalicNode
:
&
v1pb
.
ItalicNode
{
Symbol
:
n
.
Symbol
,
Content
:
n
.
Content
}}
case
*
ast
.
BoldItalic
:
...
...
@@ -107,7 +106,7 @@ func convertFromASTNode(rawNode ast.Node) *v1pb.Node {
case
*
ast
.
Image
:
node
.
Node
=
&
v1pb
.
Node_ImageNode
{
ImageNode
:
&
v1pb
.
ImageNode
{
AltText
:
n
.
AltText
,
Url
:
n
.
URL
}}
case
*
ast
.
Link
:
node
.
Node
=
&
v1pb
.
Node_LinkNode
{
LinkNode
:
&
v1pb
.
LinkNode
{
Text
:
n
.
Text
,
Url
:
n
.
URL
}}
node
.
Node
=
&
v1pb
.
Node_LinkNode
{
LinkNode
:
&
v1pb
.
LinkNode
{
Content
:
convertFromASTNodes
(
n
.
Content
)
,
Url
:
n
.
URL
}}
case
*
ast
.
AutoLink
:
node
.
Node
=
&
v1pb
.
Node_AutoLinkNode
{
AutoLinkNode
:
&
v1pb
.
AutoLinkNode
{
Url
:
n
.
URL
,
IsRawText
:
n
.
IsRawText
}}
case
*
ast
.
Tag
:
...
...
@@ -207,8 +206,7 @@ func convertToASTNode(node *v1pb.Node) ast.Node {
case
*
v1pb
.
Node_TextNode
:
return
&
ast
.
Text
{
Content
:
n
.
TextNode
.
Content
}
case
*
v1pb
.
Node_BoldNode
:
children
:=
convertToASTNodes
(
n
.
BoldNode
.
Children
)
return
&
ast
.
Bold
{
Symbol
:
n
.
BoldNode
.
Symbol
,
Children
:
children
}
return
&
ast
.
Bold
{
Symbol
:
n
.
BoldNode
.
Symbol
,
Children
:
convertToASTNodes
(
n
.
BoldNode
.
Children
)}
case
*
v1pb
.
Node_ItalicNode
:
return
&
ast
.
Italic
{
Symbol
:
n
.
ItalicNode
.
Symbol
,
Content
:
n
.
ItalicNode
.
Content
}
case
*
v1pb
.
Node_BoldItalicNode
:
...
...
@@ -218,7 +216,7 @@ func convertToASTNode(node *v1pb.Node) ast.Node {
case
*
v1pb
.
Node_ImageNode
:
return
&
ast
.
Image
{
AltText
:
n
.
ImageNode
.
AltText
,
URL
:
n
.
ImageNode
.
Url
}
case
*
v1pb
.
Node_LinkNode
:
return
&
ast
.
Link
{
Text
:
n
.
LinkNode
.
Text
,
URL
:
n
.
LinkNode
.
Url
}
return
&
ast
.
Link
{
Content
:
convertToASTNodes
(
n
.
LinkNode
.
Content
)
,
URL
:
n
.
LinkNode
.
Url
}
case
*
v1pb
.
Node_AutoLinkNode
:
return
&
ast
.
AutoLink
{
URL
:
n
.
AutoLinkNode
.
Url
,
IsRawText
:
n
.
AutoLinkNode
.
IsRawText
}
case
*
v1pb
.
Node_TagNode
:
...
...
web/src/components/MemoContent/Link.tsx
View file @
5bb4a300
...
...
@@ -2,11 +2,12 @@ import { Link as MLink, Tooltip } from "@mui/joy";
import
{
useState
}
from
"react"
;
import
{
markdownServiceClient
}
from
"@/grpcweb"
;
import
{
workspaceStore
}
from
"@/store/v2"
;
import
{
LinkMetadata
}
from
"@/types/proto/api/v1/markdown_service"
;
import
{
LinkMetadata
,
Node
}
from
"@/types/proto/api/v1/markdown_service"
;
import
Renderer
from
"./Renderer"
;
interface
Props
{
url
:
string
;
text
?:
string
;
content
?:
Node
[]
;
}
const
getFaviconWithGoogleS2
=
(
url
:
string
)
=>
{
...
...
@@ -18,7 +19,7 @@ const getFaviconWithGoogleS2 = (url: string) => {
}
};
const
Link
:
React
.
FC
<
Props
>
=
({
tex
t
,
url
}:
Props
)
=>
{
const
Link
:
React
.
FC
<
Props
>
=
({
conten
t
,
url
}:
Props
)
=>
{
const
workspaceMemoRelatedSetting
=
workspaceStore
.
state
.
memoRelatedSetting
;
const
[
initialized
,
setInitialized
]
=
useState
<
boolean
>
(
false
);
const
[
showTooltip
,
setShowTooltip
]
=
useState
<
boolean
>
(
false
);
...
...
@@ -65,7 +66,7 @@ const Link: React.FC<Props> = ({ text, url }: Props) => {
>
<
MLink
underline=
"always"
target=
"_blank"
href=
{
url
}
rel=
"noopener noreferrer"
>
<
span
onMouseEnter=
{
handleMouseEnter
}
onMouseLeave=
{
()
=>
setShowTooltip
(
false
)
}
>
{
text
||
url
}
{
content
?
content
.
map
((
child
,
index
)
=>
<
Renderer
key=
{
`${child.type}-${index}`
}
index=
{
String
(
index
)
}
node=
{
child
}
/>)
:
url
}
</
span
>
</
MLink
>
</
Tooltip
>
...
...
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