Skip to content

Commit 1fe9135

Browse files
committed
Bug fix for note to Markdown conversion of list items (issue #44)
See issue #44 on GitHub: #44
1 parent 2805297 commit 1fe9135

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

autoload/xolox/notes.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 16, 2013
3+
" Last Change: July 18, 2013
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.23'
9+
let g:xolox#notes#version = '0.23.1'
1010
let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
1111
let s:scriptdir = expand('<sfile>:p:h')
1212

autoload/xolox/notes/parser.vim

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: June 23, 2013
3+
" Last Change: July 18, 2013
44
" URL: http://peterodding.com/code/vim/notes/
55

66
function! xolox#notes#parser#parse_note(text) " {{{1
@@ -256,16 +256,22 @@ function! s:parse_paragraph(context) " {{{1
256256
" Parse the upcoming paragraph in the input stream.
257257
let lines = []
258258
while a:context.has_more()
259-
let line = s:match_line(a:context)
260-
call add(lines, line)
261-
if line =~ '^\_s*$'
262-
" An empty line marks the end of the paragraph.
263-
break
264-
elseif line[-1:] != "\n"
265-
" XXX When match_line() returns a line that doesn't end in a newline
266-
" character, it means either we hit the end of the input or the current
267-
" line continues in a code block (which is not ours to parse :-).
259+
if !empty(s:match_bullet_or_divider(a:context, 0))
260+
" If the next line starts with a list bullet it shouldn't
261+
" be included in the paragraph we're currently parsing.
268262
break
263+
else
264+
let line = s:match_line(a:context)
265+
call add(lines, line)
266+
if line =~ '^\_s*$'
267+
" An empty line marks the end of the paragraph.
268+
break
269+
elseif line[-1:] != "\n"
270+
" XXX When match_line() returns a line that doesn't end in a newline
271+
" character, it means either we hit the end of the input or the current
272+
" line continues in a code block (which is not ours to parse :-).
273+
break
274+
endif
269275
endif
270276
endwhile
271277
" Don't include empty paragraphs in the output.

0 commit comments

Comments
 (0)