mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix line separator issue
This commit is contained in:
parent
0b0cf82a75
commit
702252c4e4
@ -9,7 +9,6 @@
|
||||
|
||||
import sys
|
||||
import codecs
|
||||
import os
|
||||
from difflib import unified_diff
|
||||
|
||||
from docutils import nodes
|
||||
@ -296,9 +295,11 @@ class LiteralInclude(Directive):
|
||||
lines = res
|
||||
|
||||
if 'lineno-match' in self.options:
|
||||
# handle that preceding, empty lines ('\n') are removed.
|
||||
# handle that docutils remove preceding lines which only contains
|
||||
# line separation.
|
||||
for line in lines:
|
||||
if line != os.linesep:
|
||||
# check if line contains anything else than line separation.
|
||||
if line and line.splitlines()[0]:
|
||||
break
|
||||
linenostart += 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user