asciidoctor-browser-extension
asciidoctor-browser-extension copied to clipboard
file fails to render if extension is not lowercase
this should be case-insensitive, no? But, for example,
filename.ASC
will not render, while
filename.asc
will render.
Apparently, matches
is case-sensitive 😞
https://github.com/asciidoctor/asciidoctor-browser-extension/blob/2c1e96ee8043c3c28b5cd4fc8fc613d23867485c/app/manifest.json#L18-L49
According to https://stackoverflow.com/a/18143014/3600979 we would need to add every variation:
{
"matches": [
"*://*/*.asc",
"*://*/*.Asc",
"*://*/*.aSc",
"*://*/*.asC",
"*://*/*.ASc",
"*://*/*.ASC",
"*://*/*.aSC",
"*://*/*.AsC",
// ... and so on
]
}
Please note that the recommended file extension is adoc
.
I recommend against this change. A file extension is case sensitive, and the only official file extension for AsciiDoc moving forward is .adoc. That's what's going to be standardized. And it's going to be lowercase.
A file extension can be case-sensitive, but with certain file system formats (e.g., the default Mac OS Extended (Journaled), which is broadly agnostic toward case; or the classic DOS 8.3 format, which is uppercase only), it very well might not be.
I used .ASC
in the earlier example specifically for its compatibility with 8.3—yes, it's not the recommended .adoc
extension, but it is 8.3-friendly.
A file extension can be case-sensitive,
I was referring to the AsciiDoc file extension.
So in cases where a workflow, like mine, requires that a document pass through:
- a DOS computer (and therefore have its name conformed to an uppercase 8.3 filename)
- a Mac computer (where the system doesn't really care if it's seeing a filename.asc or FILENAME.ASC or anything in-between)
- a Linux computer (where each variation would be seen as a completely different file)
...and bounce back and forth between those...
Would it not then make the most sense to allow some degree of case insensitivity—at the very least to allow a typical FILENAME.ASC (which all three systems would agree is the same file) to be readable by this browser extension?
After giving it some thought, I don't think we should support uppercase file extension. As mentioned by Dan, the only official file extension for AsciiDoc moving forward is .adoc
.
In other words, .asc
(or in your case, .ASC
) won't be officially supported moving forward. No matter what we do, sooner or later your workflow won't be supported.
I recommend using .adoc
(for future compatibility) when you are working on mac or Linux computer. DOS is not a supported platform and as a consequence you will need to find a workaround if you want to pass an AsciiDoc document through this platform.