[fix] Disable separate selector characters for PDF and XML #1
@@ -1,7 +1,21 @@
|
|||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> This program expects that your Gopher server treats **empty lines** as **information lines**.
|
||||||
|
>
|
||||||
|
> It also expects the server to **add the hostname** and the **port** number at the end of links.
|
||||||
|
|
||||||
### Compiling
|
### Compiling
|
||||||
|
|
||||||
This program compiles like any other ordinary Go project, simply **run** `go build .` in the project directory.
|
You need to have Go toolchain installed:
|
||||||
|
```shell
|
||||||
|
# Debian
|
||||||
|
sudo apt install golang
|
||||||
|
|
||||||
|
# Fedora
|
||||||
|
sudo dnf install golang
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, just **clone the repo** and run **`go build .`** to compile an executable.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -90,14 +90,8 @@ func (params *GopherTypeCharParams) GopherTypeChar(path string, isDir bool) stri
|
|||||||
return "I"
|
return "I"
|
||||||
case strings.HasPrefix(mimeType, "audio/"):
|
case strings.HasPrefix(mimeType, "audio/"):
|
||||||
return "s"
|
return "s"
|
||||||
case mimeType == "application/pdf":
|
|
||||||
return "P"
|
|
||||||
case strings.HasPrefix(mimeType, "text/html"):
|
case strings.HasPrefix(mimeType, "text/html"):
|
||||||
return "h"
|
return "h"
|
||||||
case strings.HasPrefix(mimeType, "text/rtf"):
|
|
||||||
return "r"
|
|
||||||
case strings.HasPrefix(mimeType, "text/xml") || strings.HasPrefix(mimeType, "application/xml"):
|
|
||||||
return "X"
|
|
||||||
default:
|
default:
|
||||||
return "9"
|
return "9"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user