Created
July 17, 2019 07:47
-
-
Save sergiomonteleone/a3fc44c2c6f8ca6b54f057ac3b3fa72e to your computer and use it in GitHub Desktop.
Proposed patch to fix the zone file comment parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/parseZoneFile.js b/src/parseZoneFile.js | |
index 19c4a25..e92bf39 100644 | |
--- a/src/parseZoneFile.js | |
+++ b/src/parseZoneFile.js | |
@@ -12,7 +12,7 @@ export function parseZoneFile(text: string): ZoneFileObject { | |
}; | |
function removeComments(text) { | |
- const re = /(^|[^\\]);.*/g | |
+ const re = /^;.*/gm; | |
return text.replace(re, function(m, g1) { | |
return g1 ? g1 : '' // if g1 is set/matched, re-insert it, else remove | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment