diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 0ec1d8003..2e346b00d 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -60,6 +60,8 @@ Fixed - Error when passing a substring with spaces to `:tab-take`. - Greasemonkey scripts which start with an UTF-8 BOM are now handled correctly. +- When no documentation has been generated, the plaintext documentation now can + be shown for more files such as `qute://help/userscripts.html`. Removed ~~~~~~~ diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 5ff3f6fb0..02aac14ad 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -375,13 +375,20 @@ def qute_help(url): except OSError: # No .html around, let's see if we find the asciidoc asciidoc_path = path.replace('.html', '.asciidoc') + asciidoc_paths = [asciidoc_path] if asciidoc_path.startswith('html/doc/'): - asciidoc_path = asciidoc_path.replace('html/doc/', '../doc/help/') + asciidoc_paths += [asciidoc_path.replace('html/doc/', '../doc/help/'), + asciidoc_path.replace('html/doc/', '../doc/')] - try: - asciidoc = utils.read_file(asciidoc_path) - except OSError: - asciidoc = None + asciidoc = None + + for path in asciidoc_paths: + try: + asciidoc = utils.read_file(path) + except OSError: + pass + else: + break if asciidoc is None: raise