Skip to content

Commit d47d602

Browse files
committed
Chore: 리드미 업데이트
1 parent 84731c7 commit d47d602

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,22 @@ Next.js 기반
368368
필수는 아니지만 파일의 이름을 바꾸고 타이틀을 변경하는 경우 서로의 연결이 끊길수 있기 때문에 사용하면 좋음
369369

370370
```lua
371-
pre_write_note = function(client, note)
371+
pre_write_note = function(_, note)
372372
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
373373
local content = table.concat(lines, "\n")
374-
local first_heading = content:match("#%s*(.-)\n")
374+
-- 첫 번째 헤딩 찾기 (여러 패턴 시도)
375+
-- 패턴 1: 문서 시작 부분의 # 헤딩
376+
local first_heading = content:match("^#%s+(.-)[\r\n]")
377+
378+
-- 패턴 2: 문서 중간의 # 헤딩
379+
if not first_heading then
380+
first_heading = content:match("\n#%s+(.-)[\r\n]")
381+
end
382+
383+
-- 패턴 3: 더 관대한 패턴 (줄 끝이 아닌 어떤 문자든 허용)
384+
if not first_heading then
385+
first_heading = content:match("#%s+([^\r\n]+)")
386+
end
375387
if first_heading and #first_heading > 0 then
376388
first_heading = first_heading:gsub('[/\\:*?"<>|]', "_"):gsub("^%s*(.-)%s*$", "%1")
377389
if #first_heading > 0 then

0 commit comments

Comments
 (0)