mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Escape square brackets in file+heading based org-mode links
This commit is contained in:
parent
04610f453a
commit
51a43245d3
1 changed files with 3 additions and 1 deletions
|
@ -173,7 +173,9 @@ def makelist(filename):
|
|||
n.setHeading(prtysrch.group(2))
|
||||
|
||||
# Set SOURCE property to a file+heading based org-mode link to the entry
|
||||
n.properties['SOURCE'] = f'[[file:{filename}::*{n.Heading()}]]'
|
||||
escaped_filename = filename.replace("[","\[").replace("]","\]")
|
||||
escaped_heading = n.Heading().replace("[","\[").replace("]","\]")
|
||||
n.properties['SOURCE'] = f'[[file:{escaped_filename}::*{escaped_heading}]]'
|
||||
|
||||
return nodelist
|
||||
|
||||
|
|
Loading…
Reference in a new issue