-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
convert to markdown for web/api/abortcontroller zh-CN #7001
Conversation
Preview URLs
FlawsURL:
URL:
URL:
External URLsURL:
URL:
URL:
(this comment was updated 2022-07-20 06:07:42.134099) |
duplicate #6988 |
markdown convertion guide: https://github.com/mdn/translated-content/blob/main/docs/zh-cn/h2m-guide.md |
@yin1999 Commits copy yours, but translation content is Abortcontroller. Beacuse I am testing this yari |
Thank you, would you mind merging this commit to my pr with a Or you can create a pr after meging that one |
|
|
Still with to tasks:
No, I can use github no-reply email, I can got that. So may I go ahead for merging commit? |
Yeah |
|
unicode space-->U+00a0, replace them? |
I'm using go script to do those tasks: remove unicode space:replace all package main
import (
"bytes"
"errors"
"flag"
"fmt"
"io/fs"
"os"
"path/filepath"
"strings"
)
var limit = flag.Int("l", -1, "set limit, -1 means no limit")
var exclude = []string{"conflicting", "orphaned"}
func main() {
dir := flag.String("d", ".", "set walk dir") // example `-d mdn/translated-content/files/zh-cn` to run jobs on `zh-CN`
flag.Parse()
os.Chdir(*dir)
err := filepath.WalkDir(".", visit)
if err != nil && err != errLimitReached {
fmt.Printf("occur an error: %s\n", err.Error())
}
}
var errLimitReached = errors.New("limit reached")
func visit(path string, d fs.DirEntry, err error) error {
if d.IsDir() {
for i := range exclude {
if strings.HasPrefix(d.Name(), exclude[i]) {
return filepath.SkipDir
}
}
return nil
}
switch filepath.Ext(path) {
case ".html":
resolve(path)
}
if *limit == 0 {
return errLimitReached
}
return err
}
var (
space1 = []byte(string([]rune{'\u00A0'}))
space2 = []byte(string([]rune{'\u3000'}))
)
func resolve(path string) error {
data, err := os.ReadFile(path)
if err != nil {
fmt.Printf("[warn] cannot open file, err: %s\n", err.Error())
return err
}
newData := bytes.ReplaceAll(data, space1, []byte{' '})
newData = bytes.ReplaceAll(newData, space2, []byte{' '})
if bytes.Equal(data, newData) {
return nil
}
return os.WriteFile(path, newData, 0644)
} |
I see |
Seems the title is not correct, reopen this one. Please follow the convertion guide. |
I write node to fix unicode space errors, repair so many at a time, I don't know if there is any problem |
|
Co-authored-by: Jack <[email protected]>
Co-authored-by: Jack <[email protected]>
Or you can close this pr, I just to test yari |
Co-authored-by: Jack <[email protected]>
I've force push to clear commits |
No description provided.