Skip to content

Instantly share code, notes, and snippets.

@sergiomonteleone
Created July 17, 2019 07:47
Show Gist options
  • Save sergiomonteleone/a3fc44c2c6f8ca6b54f057ac3b3fa72e to your computer and use it in GitHub Desktop.
Save sergiomonteleone/a3fc44c2c6f8ca6b54f057ac3b3fa72e to your computer and use it in GitHub Desktop.
Proposed patch to fix the zone file comment parsing
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