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

Every text file is rendered #61

Closed ojeulin closed 7 years ago

ojeulin commented 7 years ago

Problem: When I open a local asciidoc file, renamed "foo.txt" or "foo", it is rendered in HTML. Firefox: 51.0.1 (64 bits) OS: GNU/linux I tested with a file located in 2 directories:

ggrossetie commented 7 years ago

This is weird, we are using the following RegExp: https://github.com/asciidoctor/asciidoctor-firefox-addon/blob/fb2598e0b734d182064cd9cb16a739efbbc1071f/data/asciidocify.js#L5

var regexpAdFile = /\.a(sciidoc|doc|d|sc)$|\.a(sciidoc|doc|d|sc)\?|/i;

Could you please attach a screenshot ?

ojeulin commented 7 years ago

Here are 2 screenshots, with the extension on and off.

text file - with extension off text file - with extension on vim file - with extension off vim file - with extension on

ggrossetie commented 7 years ago

Thanks! I can reproduce this issue. What version of the extension are you using ?

ojeulin commented 7 years ago

Ah, sorry, version 0.5.1 (via addons.mozilla.org)

d-nnis commented 7 years ago

I can confirm this. It happens on my setup as well: version 0.5.3, Firefox ESR 45.7.0. In conjunction with Markdown Viewer I get to see a markdown file (file is named README.md really) rendered with Asciidoc.

ggrossetie commented 7 years ago

It should be fixed in https://github.com/asciidoctor/asciidoctor-firefox-addon/pull/62 Could someone build the extension from this branch to confirm that the issue is gone ?

d-nnis commented 7 years ago

Can confirm once again, on a different computer. Firefox 45.8.0, Asciidoctorjs-live-preview), this time version 0.5.1 from the official Mozilla Addon-Site. This site gets rendered. This is really an undiserable situation. Is this something about my setups? Can I show more details so that you can fix this tiring issue?

d-nnis commented 7 years ago

As a quick fix: Offer to setup a keyboard shortcut to activate/de-activate the addon quickly :-D

mojavelinux commented 7 years ago

I don't think there's any confusion that the published version has the wrong behavior. Any fix, whether the correct fix or a workaround, requires publishing a new version. And the correct fix has already been determined. So it's just a matter of getting the new version published at this point.

ggrossetie commented 7 years ago

Version 0.5.5 released. Could you please uninstall the extension and install version 0.5.5: https://github.com/asciidoctor/asciidoctor-firefox-addon/releases/tag/v0.5.5

  1. Download asciidoctor-firefox-addon-0.5.5-signed.xpi
  2. Drag and drop the file into Firefox
  3. Install, restart the browser
  4. Enjoy! (only .ad, .adoc, .asc, .asciidoc should be rendered)
d-nnis commented 7 years ago

Yes! I do enjoy (only asciidoc-files) with version 0.5.5.

Thanks for working it out. :honeybee:

ggrossetie commented 7 years ago

Awesome :beetle: :smile:

d-nnis commented 7 years ago

My life now seems so much better with emojis. :rage2: (It's like I'm turning teenage again.) What would I do without them? :shell:

It is a pity though, github does not support emoji-sounds. I would definitely go for /play trololo ( Check here, scroll to the bottom if your're interested ;-) )

ojeulin commented 7 years ago

Yes, it works, thanks 👍