Closed lucascosti closed 9 years ago
Hello @lucascosti do you have any attributes defined on your document ? Is it a remote or a local document ? With version 0.2.3.1-signed and Firefox 38 (Windows), the following document is working:
= Test
NOTE: This is working !
Hi @Mogztter , thanks for the reply. It is a local file, and I do have attributes.
If I remove the attributes, it does continue to render the document after I add an admonition.
Also another issue: unlike the Chrome extension, the 'live' aspect doesn't work in Firefox for me. After I save the source file, I have to manually refresh Firefox to see the changes displayed (whereas Chrome automatically refreshes the changes when the focus shifts to the Chrome window).
I am using 0.2.3.1-signed in Firefox 38.0.1 (Fedora 21).
Could you copy and paste your attributes (or your whole document) beacause I couldn't reproduce this issue... thanks
@lucascosti ping :)
Sorry, @Mogztter. A good example of a document that works in the Chrome extension, but not the Firefox one is:
Admonitions are breaking the rendering, and it seems to be the :icons: attribute that my team uses in our docs.
Although the document renders if I remove the attribute, the 'live' functionality still doesn't work. (I can still manually refresh the page, or set up an automatic refresh, which is what I think the Chrome extension does natively).
Aha. The problem is the combination of the icons
and the data-uri
. You are asking the processor to read icons from disk and embed them into the document, which isn't going to work in the browser preview. You either need to use icons: font
or no icons at all. With Asciidoctor, you almost never want to use the icons
attribute by itself unless you really intend to use custom icon files.
ah, makes sense. Although I am new to writing for the OpenShift docs team, I assume there are custom icons being used for the end-product (that doc is based on their template). The built version of that file is here: https://docs.openshift.com/enterprise/3.0/using_images/xpaas_images/eap.html
The Chrome extension renders the doc (albeit with broken images for the admonitions) :)
Nope, the published file uses font-based icons. More than likely the build script is overriding the icons
attribute, so what we're really looking at is that the source document just has the wrong attribute defined. I also don't recommend setting data-uri
in the document itself. This should almost always be a decision of the build script.
Long story, short. I think these two attributes should be removed from the document:
:data-uri:
:icons:
and replaced with:
:icons: font
However, to continue on with this issue, I think the extension (both Chrome and Firefox) should forcefully disable data-uri
to avoid this type of problem.
Cool, thanks Dan. I'll let the OpenShift guys know that they might want to change their templates.
:+1:
@lucascosti On a side note I got the exact same Yoshi figurine !
@mojavelinux How can I disable an data-uri
attribute ? SECURE
mode can do that but I don't want to force the user's safe mode
I'm pretty sure if we just add data-uri! to the attributes passed into the API, it will do the trick.
Sorry to hijack this closed report, but this is way too related to post it somewhere else: what if one actually wants to use the data-uri attribute? After all, that attribute is documented to force embedding of images into the html output (which relieves the user from managing the image files himself).
There's no use case (that I can really see) for using data-uri
in the preview extension. It's a flag for bundling and publishing in a build. The preview extension is just displaying the document and there's no need to embed the assets as they are available via linking. Besides, it won't work anyway because it can't read the binary files in JavaScript.
Whenever I include an admonition (e.g.
NOTE: blah blah
), the preview in Firefox disappears. :(The same source seems to work ok in the Chrome extension.