(execCtx ExecutionContext, filePath, oldString string)
| 1424 | return fmt.Sprintf("[ErrCode %d] %s: %s", code.value, code.name, detail) |
| 1425 | } |
| 1426 | return fmt.Sprintf("[ErrCode %d] %s", code.value, code.name) |
| 1427 | } |
| 1428 | |
| 1429 | var curlyToStraight = map[rune]rune{'“': '"', '”': '"', '‘': '\'', '’': '\''} |
| 1430 | |
| 1431 | func normalizeQuotes(text string) string { |
| 1432 | return strings.Map(func(r rune) rune { |
| 1433 | if repl, ok := curlyToStraight[r]; ok { |
| 1434 | return repl |
| 1435 | } |
| 1436 | return r |
| 1437 | }, text) |
| 1438 | } |
| 1439 | |
| 1440 | func stripTrailingWhitespace(text, filePath string) string { |
| 1441 | ext := strings.ToLower(filepath.Ext(filePath)) |
| 1442 | if ext == ".md" || ext == ".mdx" { |
| 1443 | return text |
| 1444 | } |
no test coverage detected