diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2010-10-02 09:27:56 +1300 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2010-10-02 09:27:56 +1300 |
commit | 624fcbee93df21e560d39d9f62566578f41e93e1 (patch) | |
tree | 48af59777a5e4764bfd93d5c33bf795101734316 | |
parent | 8cc1ebccd961dd1a02a203012c7512f01a369b14 (diff) | |
download | asciidoc-624fcbee93df21e560d39d9f62566578f41e93e1.tar.gz |
FIXED: Filter commands located in filter directories local to the source
document where not being found. Reported here
http://groups.google.com/group/asciidoc/browse_thread/thread/1b445ca971174666
by Svenn Are Bjerkem.
-rwxr-xr-x | asciidoc.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/asciidoc.py b/asciidoc.py index 6489d83..57753c4 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -679,13 +679,17 @@ def filter_lines(filter_cmd, lines, attrs={}): if not os.path.dirname(cmd): # Filter command has no directory path so search filter directories. filtername = attrs.get('style') - if USER_DIR: - found = findfilter(filtername, USER_DIR, cmd) + d = document.attributes.get('docdir') + if d: + found = findfilter(filtername, d, cmd) if not found: - if localapp(): - found = findfilter(filtername, APP_DIR, cmd) - else: - found = findfilter(filtername, CONF_DIR, cmd) + if USER_DIR: + found = findfilter(filtername, USER_DIR, cmd) + if not found: + if localapp(): + found = findfilter(filtername, APP_DIR, cmd) + else: + found = findfilter(filtername, CONF_DIR, cmd) else: if os.path.isfile(cmd): found = cmd |