Closed zaxebo1 closed 8 years ago
That is,
link:b1.adoc[Second document]
^is not working correctly in firefox addon of asciidoctor, though it works correctly in opera and chromium addon of asciidoctor
This traces back to use setting the outfilesuffix to .adoc
in the Chrome & Opera extensions, if I remember correctly.
i could not understand your suggestion. "Is it a bug" OR " i need to do some setting in my own asciidoc document" - in order to get it working?
(this is the most urgent issue for me, as we always use firefox. "If possible , suggest something soon" . Thanks in advance )
I'm saying that I remember having this discussion with @Mogztter while developing the Chrome extension, so likely the fix just needs to be ported. The outfilesuffix
attribute needs to be set in the plugin code.
@mojavelinux I think you are right (good memory!) I will do some testing this week-end
:+1:
thanks to both of you. :+1:
I have a bad news... Mozilla forces me to sanitize the HTML produced by Asciidoctor: https://github.com/asciidoctor/asciidoctor-firefox-addon/blob/master/lib/main.js#L81
The link is correctly converted by Asciidoctor but the href
attribute is then removed by the sanitize method.
Right you are! It seems like the sanitizer strips any href that is a relative path. I tried it behind a webserver and the result is still the same. How annoying.
The issue I was talking about is actually different, but related. If you use the interdocument xref (e.g., <<other.adoc#>>
then we need to set the outfilesuffix
to match the file extension of the current file. Otherwise, it will try to link to a .html file. However, that's pointless to set since the sanitizer is erasing the href anyway.
We need to find out if this is a hard requirement for the add-on because breaking relative links kind of breaks the point of a web browser.
Just read that absolute links are not striped away.
Is there a way to tell Asciidoctor to expand relative paths to absolute paths (using the current directory) ? Le 5 juil. 2015 12:57 AM, "Dan Allen" notifications@github.com a écrit :
Right you are! It seems like the sanitizer strips any href that is a relative path. I tried it behind a webserver and the result is still the same. How annoying.
The issue I was talking about is actually different, but related. If you use the interdocument xref (e.g., <<other.adoc#>> then we need to set the outfilesuffix to match the file extension of the current file. Otherwise, it will try to link to a .html file. However, that's pointless to set since the sanitizer is erasing the href anyway.
We need to find out if this is a hard requirement for the add-on because breaking relative links kind of breaks the point of a web browser.
— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-firefox-addon/issues/31#issuecomment-118561366 .
Just read that absolute links are not striped away.
From what I remember from my tests, file://
URLs are stripped away no matter what, so I'm not sure if this will solve the problem for a local file preview.
Is there a way to tell Asciidoctor to expand relative paths to absolute paths
Sort of, using the relfileprefix
, but you have to set it explicitly. It should cover all the cases of inter-document xrefs, but not sure. See https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/substitutors.rb#L1090
Have this been solved?
No, Mozilla sanitize is too restrictive and I didn't try (yet) Dan's workaround with relfileprefix
What happened with Mozilla's Satanizer? :/
This is evil !
Wow! Does it mean that - 'this is fixed and working in firefox now' ?
@zaxebo1 Yes, you can manually install the 0.5.0 release: https://github.com/asciidoctor/asciidoctor-firefox-addon/releases/tag/v0.5.0
TL;DR version= "link:" does not goto target document on asccidoctor firefox addon, though it works on chromium and opera addon .
Detail=
Let there be a1.adoc
Let there be b1.adoc
Now i put a1.adoc and b1.bdoc on apache webserver on another machine2 (IP= 192.168.1.2) in my local network. Then sitting on machine1 (IP=192.168.1.1), i browsed to http://192.168.1.2/a.doc , then in opera and chromium addons for asciidoctor - when i click the link "Second document", then it correctly goes to b1.adoc . BUT when i click the same link "Second document" in firefox, then nothing happens (that is, the browser does not goto b1.adoc
Please correct this bug at earliest(if possible), as my all the documents are interlinked using "link:" and the we always use the inbuilt firefox browser in linux. Thanks in advance