Skip to content

Commit

Permalink
fix: logseq reference with provided options bad parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
stdword committed Apr 2, 2023
1 parent 2839d2f commit d88d37f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/utils/logseq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ export function parseReference(ref: string): LogseqReference | null {
let value: string | number = ref
let option = ''

if (value.length > 1 && '+-'.indexOf(value[0]) >= 0) {
const first = value[0]

// escaping to reference pages started with + or -
if (!value.startsWith(option.repeat(2))) {
const first = value[0]
if (value.length > 1 && ['+', '-'].includes(first)) {
// escaping to handle case: reference pages started with + or -
if (!value.startsWith(first.repeat(2))) {
option = first
value = value.slice(1)
value = value.slice(1).trim()
}
}

Expand Down

0 comments on commit d88d37f

Please sign in to comment.