Skip to content

Commit

Permalink
graph, tag 에서 markdown link 이름에 공백이 있는 경우도 허용
Browse files Browse the repository at this point in the history
[shell script](shell-script)
vimwiki markdown 설정에서는 엔터입력시 기본적으로 `-` -> ` ` 으로 변환되어 기존 정규표현식이 동작하지 않음
때문에 이름에 공백이 있으면 이를 먼저 `-` 변환후에 정규표현식 매치
  • Loading branch information
deptno committed Oct 28, 2023
1 parent 49517f3 commit 23bfff8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/wiki/getGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ export const getGraph = () => {
l.replace(RE_VIMWIKI_LINK, getNameFromLink)
)
})
const markdownLinks = (markdown.match(RE_MARKDOWN_LINK) ?? [])
const markdownLinks = (
markdown
// vimwiki markdown 설정에서 enter 를 치면 `-` 대신 space가 이름에 입력됨
.replace(/ /g, '-')
.match(RE_MARKDOWN_LINK)
?? []
)
.map((l: string) => {
return join(
getMakrdownLinkBaseName(source, l),
Expand Down

0 comments on commit 23bfff8

Please sign in to comment.