Skip to content

Support localized README #20508

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

Merged
merged 7 commits into from
Jul 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update modules/markup/renderer.go
  • Loading branch information
zeripath authored Jul 27, 2022
commit db31645e4aa93a8107908294967898e6c1ac4870
6 changes: 4 additions & 2 deletions modules/markup/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ func IsReadmeFile(name string) bool {
}

// IsReadmeFileExtension reports whether name looks like a README file
// based on its name. If an extension is provided, it will strictly
// match that extension.
// based on its name. It will look through the provided extensions and check if the file matches
// one of the extensions and provide the index in the extension list.
// If the filename is `readme.` with an unmatched extension it will match with the index equaling
// the length of the provided extension list.
// Note that the '.' should be provided in ext, e.g ".md"
func IsReadmeFileExtension(name string, ext ...string) (int, bool) {
if len(name) < 6 || name[:6] != "readme" {
Expand Down