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
2c4b5d75
Commit
2c4b5d75
authored
Dec 17, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix html escaping
parent
770607f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
18 deletions
+6
-18
frontend.go
server/frontend/frontend.go
+6
-5
migration_history.go
store/migration_history.go
+0
-12
test.go
test/test.go
+0
-1
No files found.
server/frontend/frontend.go
View file @
2c4b5d75
...
...
@@ -3,6 +3,7 @@ package frontend
import
(
"embed"
"fmt"
"html/template"
"io/fs"
"net/http"
"strings"
...
...
@@ -172,14 +173,14 @@ func generateMemoMetadata(memo *store.Memo, creator *store.User) string {
}
metadataList
:=
[]
string
{
fmt
.
Sprintf
(
`<meta name="description" content="%s" />`
,
description
),
fmt
.
Sprintf
(
`<meta property="og:title" content="%s" />`
,
fmt
.
Sprintf
(
"%s(@%s) on Memos"
,
creator
.
Nickname
,
creator
.
Username
)),
fmt
.
Sprintf
(
`<meta property="og:description" content="%s" />`
,
description
),
fmt
.
Sprintf
(
`<meta name="description" content="%s" />`
,
template
.
HTMLEscapeString
(
description
)
),
fmt
.
Sprintf
(
`<meta property="og:title" content="%s" />`
,
template
.
HTMLEscapeString
(
fmt
.
Sprintf
(
"%s(@%s) on Memos"
,
creator
.
Nickname
,
creator
.
Username
)
)),
fmt
.
Sprintf
(
`<meta property="og:description" content="%s" />`
,
template
.
HTMLEscapeString
(
description
)
),
fmt
.
Sprintf
(
`<meta property="og:image" content="%s" />`
,
"https://www.usememos.com/logo.png"
),
`<meta property="og:type" content="website" />`
,
// Twitter related metadata.
fmt
.
Sprintf
(
`<meta name="twitter:title" content="%s" />`
,
fmt
.
Sprintf
(
"%s(@%s) on Memos"
,
creator
.
Nickname
,
creator
.
Username
)),
fmt
.
Sprintf
(
`<meta name="twitter:description" content="%s" />`
,
description
),
fmt
.
Sprintf
(
`<meta name="twitter:title" content="%s" />`
,
template
.
HTMLEscapeString
(
fmt
.
Sprintf
(
"%s(@%s) on Memos"
,
creator
.
Nickname
,
creator
.
Username
)
)),
fmt
.
Sprintf
(
`<meta name="twitter:description" content="%s" />`
,
template
.
HTMLEscapeString
(
description
)
),
fmt
.
Sprintf
(
`<meta name="twitter:image" content="%s" />`
,
"https://www.usememos.com/logo.png"
),
`<meta name="twitter:card" content="summary" />`
,
}
...
...
store/migration_history.go
View file @
2c4b5d75
package
store
import
(
"context"
)
type
MigrationHistory
struct
{
Version
string
CreatedTs
int64
...
...
@@ -15,11 +11,3 @@ type UpsertMigrationHistory struct {
type
FindMigrationHistory
struct
{
}
func
(
s
*
Store
)
FindMigrationHistoryList
(
ctx
context
.
Context
,
find
*
FindMigrationHistory
)
([]
*
MigrationHistory
,
error
)
{
return
s
.
driver
.
FindMigrationHistoryList
(
ctx
,
find
)
}
func
(
s
*
Store
)
UpsertMigrationHistory
(
ctx
context
.
Context
,
upsert
*
UpsertMigrationHistory
)
(
*
MigrationHistory
,
error
)
{
return
s
.
driver
.
UpsertMigrationHistory
(
ctx
,
upsert
)
}
test/test.go
View file @
2c4b5d75
...
...
@@ -33,7 +33,6 @@ func GetTestingProfile(t *testing.T) *profile.Profile {
if
driver
==
"sqlite"
{
dsn
=
fmt
.
Sprintf
(
"%s/memos_%s.db"
,
dir
,
mode
)
}
println
(
"dsn"
,
dsn
,
driver
)
return
&
profile
.
Profile
{
Mode
:
mode
,
Port
:
port
,
...
...
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