Фикс для поддержки русского языка

This commit is contained in:
Alexander NeonXP Kiryukhin 2024-06-08 21:34:02 +03:00
parent 4751370ac4
commit b77fac7564
Signed by: NeonXP
GPG key ID: 35E33E1AB7776B39
11 changed files with 19 additions and 19 deletions

View file

@ -1,5 +1,5 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/n0x1m/md2gmi)](https://goreportcard.com/report/github.com/n0x1m/md2gmi)
[![GoDoc](https://godoc.org/github.com/n0x1m/md2gmi?status.svg)](https://godoc.org/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/gitrepo.ru/neonxp/md2gmi?status.svg)](https://godoc.org/gitrepo.ru/neonxp/md2gmi)
# md2gmi
@ -25,7 +25,7 @@ Usage of ./md2gmi:
### Example
go get github.com/n0x1m/md2gmi
go get gitrepo.ru/neonxp/md2gmi
cat file.md | md2gmi
md2gmi -i file.md -o file.gmi

2
go.mod
View file

@ -1,3 +1,3 @@
module github.com/n0x1m/md2gmi
module gitrepo.ru/neonxp/md2gmi
go 1.16

View file

@ -5,8 +5,8 @@ import (
"fmt"
"os"
"github.com/n0x1m/md2gmi/mdproc"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/mdproc"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
func main() {

View file

@ -4,7 +4,7 @@ import (
"bytes"
"regexp"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
func FormatHeadings(in chan pipe.StreamItem) chan pipe.StreamItem {

View file

@ -5,7 +5,7 @@ import (
"fmt"
"regexp"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
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
re := regexp.MustCompile(`---.*---`)
// 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 {
data := b.Payload()

View file

@ -3,8 +3,8 @@ package mdproc_test
import (
"testing"
"github.com/n0x1m/md2gmi/mdproc"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/mdproc"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
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` + "`" + `.
@ -52,7 +52,7 @@ Gemini[1] · RSS[2] · About[3] · Github[4]
=> gemini://nox.im 1: Gemini
=> /index.xml 2: RSS
=> /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` + "`" + `.

View file

@ -5,7 +5,7 @@ import (
"fmt"
"regexp"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
func FormatLinks(in chan pipe.StreamItem) chan pipe.StreamItem {

View file

@ -4,7 +4,7 @@ import (
"bytes"
"regexp"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
// state function.

View file

@ -4,8 +4,8 @@ import (
"strings"
"testing"
"github.com/n0x1m/md2gmi/mdproc"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/mdproc"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
const (

View file

@ -6,7 +6,7 @@ import (
"io"
"os"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
func reader(in string) (io.Reader, error) {

View file

@ -5,7 +5,7 @@ import (
"io"
"os"
"github.com/n0x1m/md2gmi/pipe"
"gitrepo.ru/neonxp/md2gmi/pipe"
)
func writer(out string) (io.Writer, error) {