Skip to content
Permalink
Browse files
merged master
  • Loading branch information
ralsina committed Sep 15, 2015
2 parents 8845dfd + 4e0142b commit da8080423be632849a40be301444e148c048e2e1
Showing with 7 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +6 −2 nikola/plugins/compile/rest/listing.py
@@ -21,6 +21,7 @@ Bugfixes

* Look for bundle assets also in output/, allowing bundling of files
created by plugins (Issue #1370)
* In listings, if lexer is not specified, use literal (Issue #2078)
* Remove bogus ambiguity on listing links (Issue #2080)
* Unix-slash caused conflict in windows (Issue #2079)
* Locale is now threadsafe, avoid races in threaded builds (Issue #2071)
@@ -171,7 +171,12 @@ def run(self):
"""Run listing directive."""
_fname = self.arguments.pop(0)
fname = _fname.replace('/', os.sep)
lang = self.arguments.pop(0)
try:
lang = self.arguments.pop(0)
self.options['code'] = lang
except IndexError:
self.options['literal'] = True

if len(self.folders) == 1:
listings_folder = next(iter(self.folders.keys()))
if fname.startswith(listings_folder):
@@ -181,7 +186,6 @@ def run(self):
else:
fpath = os.path.join(fname) # must be new syntax: specify folder name
self.arguments.insert(0, fpath)
self.options['code'] = lang
if 'linenos' in self.options:
self.options['number-lines'] = self.options['linenos']
with io.open(fpath, 'r+', encoding='utf8') as fileobject:

0 comments on commit da80804

Please sign in to comment.