Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file fails to render if extension is not lowercase #536

Open
kentkercher opened this issue Jun 16, 2021 · 6 comments
Open

file fails to render if extension is not lowercase #536

kentkercher opened this issue Jun 16, 2021 · 6 comments
Labels

Comments

@kentkercher
Copy link

this should be case-insensitive, no? But, for example,

filename.ASC

will not render, while

filename.asc

will render.

@ggrossetie
Copy link
Member

Apparently, matches is case-sensitive 😞

"matches": [
"*://*/*.ad",
"*://*/*.ad?*",
"*://*/*.ad.*",
"*://*/*.adoc",
"*://*/*.adoc?*",
"*://*/*.adoc.*",
"*://*/*.asc",
"*://*/*.asc?*",
"*://*/*.asc.*",
"*://*/*.asciidoc",
"*://*/*.asciidoc?*",
"*://*/*.asciidoc.*",
"*://*/*.txt",
"*://*/*.txt?*",
"*://*/*.txt.*",
"file://*/*.ad",
"file://*/*.ad?*",
"file://*/*.ad.*",
"file://*/*.adoc",
"file://*/*.adoc?*",
"file://*/*.adoc.*",
"file://*/*.asc",
"file://*/*.asc?*",
"file://*/*.asc.*",
"file://*/*.asciidoc",
"file://*/*.asciidoc?*",
"file://*/*.asciidoc.*",
"file://*/*.txt",
"file://*/*.txt?*",
"file://*/*.txt.*"
],

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.

@mojavelinux
Copy link
Member

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.

@kentkercher
Copy link
Author

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.

@mojavelinux
Copy link
Member

A file extension can be case-sensitive,

I was referring to the AsciiDoc file extension.

@kentkercher
Copy link
Author

So in cases where a workflow, like mine, requires that a document pass through:

  1. a DOS computer (and therefore have its name conformed to an uppercase 8.3 filename)
  2. a Mac computer (where the system doesn't really care if it's seeing a filename.asc or FILENAME.ASC or anything in-between)
  3. 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?

@ggrossetie
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants