asciidoctor / asciidoctor-firefox-addon

:wolf: An add-on for Mozilla Firefox that converts AsciiDoc files to HTML directly in the browser using Asciidoctor.js.
https://addons.mozilla.org/en-US/firefox/addon/asciidoctorjs-live-preview/
MIT License
32 stars 9 forks source link

Includes with relative paths not working #63

Closed sverremb closed 7 years ago

sverremb commented 7 years ago

See https://github.com/asciidoctor/asciidoctor.js/issues/273

This was reported as an error in the asciidoc extension to Brackets, but is also present in the firefox addon.

ggrossetie commented 7 years ago

Hellow @sverremb, are you using a Windows path ?

sverremb commented 7 years ago

Well, it is a network path, like \\share\folder\file.css.

We have a css-file for the asciidoc document on a network share. When using the asciidoc plugin for Firefox, it doesn't seem to read the css on the network share, as I see the default asciidoc theme in the document.

Thanks for looking into it!

mojavelinux commented 7 years ago

Asciidoctor does support UNC (network) paths, so this is probably part of the recent path fixes in Asciidoctor.js to allow full support for paths.

mojavelinux commented 7 years ago

...except I'm still not sure it would work given this is a browser environment. It really depends whether xmlhttprequest can read a file from a UNC. We may be short-circuiting because it cannot. I really can't remember.

We have a css-file for the asciidoc document on a network share.

That's actually a different case. The Asciidoctor processor doesn't read the CSS when creating an embeddable document, as it does in the browser plugin. The plugin itself may offer a custom stylesheet setting, but that's separate from the processor.

ggrossetie commented 7 years ago

We've made a lot of changes in Asciidoctor.js, so this issue may be resolved.

Plus you can now configure a custom stylesheet from the options page with the new browser extension: https://github.com/asciidoctor/asciidoctor-chrome-extension

@sverremb If it still does not work, please open a new issue here: https://github.com/asciidoctor/asciidoctor-chrome-extension/issues