mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor sphinx.io; SphinxFileInput can expect that app argument is always available
This commit is contained in:
parent
a0200ad499
commit
aa4fd0e1b7
@ -141,10 +141,11 @@ class SphinxFileInput(FileInput):
|
||||
def read(self):
|
||||
# type: () -> unicode
|
||||
data = FileInput.read(self)
|
||||
if self.app:
|
||||
arg = [data]
|
||||
self.app.emit('source-read', self.env.docname, arg)
|
||||
data = arg[0]
|
||||
|
||||
# emit source-read event
|
||||
arg = [data]
|
||||
self.app.emit('source-read', self.env.docname, arg)
|
||||
data = arg[0]
|
||||
|
||||
parser = self.app.registry.get_source_parser(self.source_path)
|
||||
docinfo, data = split_docinfo(data)
|
||||
|
Loading…
Reference in New Issue
Block a user