Фикс для поддержки русского языка
This commit is contained in:
parent
4751370ac4
commit
b77fac7564
11 changed files with 19 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
||||||
[![Go Report Card](https://goreportcard.com/badge/github.com/n0x1m/md2gmi)](https://goreportcard.com/report/github.com/n0x1m/md2gmi)
|
[![Go Report Card](https://goreportcard.com/badge/gitrepo.ru/neonxp/md2gmi)](https://goreportcard.com/report/gitrepo.ru/neonxp/md2gmi)
|
||||||
[![GoDoc](https://godoc.org/github.com/n0x1m/md2gmi?status.svg)](https://godoc.org/github.com/n0x1m/md2gmi)
|
[![GoDoc](https://godoc.org/gitrepo.ru/neonxp/md2gmi?status.svg)](https://godoc.org/gitrepo.ru/neonxp/md2gmi)
|
||||||
|
|
||||||
# md2gmi
|
# md2gmi
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ Usage of ./md2gmi:
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
go get github.com/n0x1m/md2gmi
|
go get gitrepo.ru/neonxp/md2gmi
|
||||||
cat file.md | md2gmi
|
cat file.md | md2gmi
|
||||||
md2gmi -i file.md -o file.gmi
|
md2gmi -i file.md -o file.gmi
|
||||||
|
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
||||||
module github.com/n0x1m/md2gmi
|
module gitrepo.ru/neonxp/md2gmi
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
4
main.go
4
main.go
|
@ -5,8 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/mdproc"
|
"gitrepo.ru/neonxp/md2gmi/mdproc"
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FormatHeadings(in chan pipe.StreamItem) chan pipe.StreamItem {
|
func FormatHeadings(in chan pipe.StreamItem) chan pipe.StreamItem {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RemoveFrontMatter(in chan pipe.StreamItem) chan pipe.StreamItem {
|
func RemoveFrontMatter(in chan pipe.StreamItem) chan pipe.StreamItem {
|
||||||
|
@ -15,7 +15,7 @@ func RemoveFrontMatter(in chan pipe.StreamItem) chan pipe.StreamItem {
|
||||||
// delete the entire front matter
|
// delete the entire front matter
|
||||||
re := regexp.MustCompile(`---.*---`)
|
re := regexp.MustCompile(`---.*---`)
|
||||||
// but parse out the title as we want to reinject it
|
// but parse out the title as we want to reinject it
|
||||||
re2 := regexp.MustCompile(`title:[ "]*([a-zA-Z0-9 :!'@#$%^&*)(]+)["]*`)
|
re2 := regexp.MustCompile(`title:[ "]*([а-яА-Яa-zA-Z0-9 :!'@#$%^&*)(]+)["]*`)
|
||||||
|
|
||||||
for b := range in {
|
for b := range in {
|
||||||
data := b.Payload()
|
data := b.Payload()
|
||||||
|
|
|
@ -3,8 +3,8 @@ package mdproc_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/mdproc"
|
"gitrepo.ru/neonxp/md2gmi/mdproc"
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMdDocument2Gmi(t *testing.T) {
|
func TestMdDocument2Gmi(t *testing.T) {
|
||||||
|
@ -23,7 +23,7 @@ nox, Latin "night; darkness"
|
||||||
-"-"-
|
-"-"-
|
||||||
` + "```" + `
|
` + "```" + `
|
||||||
|
|
||||||
[Gemini](gemini://nox.im) · [RSS](/index.xml) · [About](/about) · [Github](https://github.com/n0x1m)<!-- · [Twitter](https://twitter.com/_noxim) -->
|
[Gemini](gemini://nox.im) · [RSS](/index.xml) · [About](/about) · [Github](https://gitrepo.ru/neonxp)<!-- · [Twitter](https://twitter.com/_noxim) -->
|
||||||
|
|
||||||
Contact me via ` + "`" + `dre@nox.im` + "`" + `. You may use my [age](/snippets/actually-good-encryption/) public key to send me files securely: ` + "`" + `age1vpyptw64mz2vhtj7tvfh9saj0y8zy8fguety5n3wpmwzpkn0rd6swh02an` + "`" + `.
|
Contact me via ` + "`" + `dre@nox.im` + "`" + `. You may use my [age](/snippets/actually-good-encryption/) public key to send me files securely: ` + "`" + `age1vpyptw64mz2vhtj7tvfh9saj0y8zy8fguety5n3wpmwzpkn0rd6swh02an` + "`" + `.
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ Gemini[1] · RSS[2] · About[3] · Github[4]
|
||||||
=> gemini://nox.im 1: Gemini
|
=> gemini://nox.im 1: Gemini
|
||||||
=> /index.xml 2: RSS
|
=> /index.xml 2: RSS
|
||||||
=> /about 3: About
|
=> /about 3: About
|
||||||
=> https://github.com/n0x1m 4: Github
|
=> https://gitrepo.ru/neonxp 4: Github
|
||||||
|
|
||||||
Contact me via ` + "`" + `dre@nox.im` + "`" + `. You may use my age[1] public key to send me files securely: ` + "`" + `age1vpyptw64mz2vhtj7tvfh9saj0y8zy8fguety5n3wpmwzpkn0rd6swh02an` + "`" + `.
|
Contact me via ` + "`" + `dre@nox.im` + "`" + `. You may use my age[1] public key to send me files securely: ` + "`" + `age1vpyptw64mz2vhtj7tvfh9saj0y8zy8fguety5n3wpmwzpkn0rd6swh02an` + "`" + `.
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FormatLinks(in chan pipe.StreamItem) chan pipe.StreamItem {
|
func FormatLinks(in chan pipe.StreamItem) chan pipe.StreamItem {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
// state function.
|
// state function.
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/mdproc"
|
"gitrepo.ru/neonxp/md2gmi/mdproc"
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func reader(in string) (io.Reader, error) {
|
func reader(in string) (io.Reader, error) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/n0x1m/md2gmi/pipe"
|
"gitrepo.ru/neonxp/md2gmi/pipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func writer(out string) (io.Writer, error) {
|
func writer(out string) (io.Writer, error) {
|
||||||
|
|
Loading…
Reference in a new issue