Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
check:
name: Lint · Typecheck · Test · Build
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/noteser-properties/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function tableToMarkdown(columns, rows) {
r.folderPath || '',
...columns.map((c) => {
const v = r.frontmatter ? r.frontmatter[c.key] : undefined
return valueToText(v).replace(/\|/g, '\\|')
return valueToText(v).replace(/\\/g, '\\\\').replace(/\|/g, '\\|')
}),
]
lines.push(`| ${cells.join(' | ')} |`)
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/settingsModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('SettingsModal — 2-pane layout', () => {
fireEvent.click(screen.getByTestId('settings-cat-about'))
const links = screen.getAllByRole('link')
expect(links.some(a => a.getAttribute('href') === 'https://thetechjon.com')).toBe(true)
expect(links.some(a => a.getAttribute('href')?.includes('github.com'))).toBe(true)
expect(links.some(a => a.getAttribute('href') === 'https://github.com/ipapakonstantinou/noteser')).toBe(true)
})

test('returns null when modal is closed', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/subscribe/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function POST(request: Request) {
}

const email = (body.email ?? '').trim().toLowerCase()
if (!email || !EMAIL_RE.test(email) || email.length > 254) {
if (!email || email.length > 254 || !EMAIL_RE.test(email)) {
return NextResponse.json({ error: 'invalid_email', message: 'That does not look like a valid email address.' }, { status: 400 })
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/propertiesPluginLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function tableToMarkdown(
r.folderPath || '',
...columns.map((c) => {
const v = r.frontmatter ? r.frontmatter[c.key] : undefined
return valueToText(v).replace(/\|/g, '\\|')
return valueToText(v).replace(/\\/g, '\\\\').replace(/\|/g, '\\|')
}),
]
lines.push(`| ${cells.join(' | ')} |`)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/embeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function formatEmbed(title: string, body: string): string {
}

function escapeMd(s: string): string {
return s.replace(/[`*_]/g, '\\$&')
return s.replace(/[\\`*_]/g, '\\$&')
}

// Format an attachment path as a markdown image destination. CommonMark only
Expand Down
Loading