From 5b8481e5bfcd2f167133f9b62c40e9618efd3d00 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Thu, 28 Jul 2022 20:37:58 -0600 Subject: [PATCH] remove duplicate newlines in definitions this prevents entries from have empty lines which are particularly annoying when using the popup dictionary in yomichan --- epwing.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epwing.go b/epwing.go index 5005b01..0bf9d88 100644 --- a/epwing.go +++ b/epwing.go @@ -68,6 +68,8 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p str = strings.Replace(str, matches[0], replacement, -1) } + pattern := regexp.MustCompile("\n+") + str = pattern.ReplaceAllLiteralString(str, "\n") return str }