|
1 | 1 | " Vim auto-load script
|
2 | 2 | " Author: Peter Odding <peter@peterodding.com>
|
3 |
| -" Last Change: June 23, 2013 |
| 3 | +" Last Change: July 18, 2013 |
4 | 4 | " URL: http://peterodding.com/code/vim/notes/
|
5 | 5 |
|
6 | 6 | function! xolox#notes#parser#parse_note(text) " {{{1
|
@@ -256,16 +256,22 @@ function! s:parse_paragraph(context) " {{{1
|
256 | 256 | " Parse the upcoming paragraph in the input stream.
|
257 | 257 | let lines = []
|
258 | 258 | 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. |
268 | 262 | 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 |
269 | 275 | endif
|
270 | 276 | endwhile
|
271 | 277 | " Don't include empty paragraphs in the output.
|
|
0 commit comments