Skip to content

Instantly share code, notes, and snippets.

@arlolra
Created July 31, 2015 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arlolra/08adb3082923cd95af81 to your computer and use it in GitHub Desktop.
Save arlolra/08adb3082923cd95af81 to your computer and use it in GitHub Desktop.
diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index 221347a..de8cb01 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -1159,7 +1159,9 @@ nowiki_content
})
)* {
// return nowiki tags as well?
- return tu.flattenStringlist(ts);
+ return tu.flattenStringlist(ts).map(function(s) {
+ return (typeof s === 'string') ? s.replace(/\s+/g, ' ') : s;
+ });
}
/* Generic XML-like tags
@cscott
Copy link

cscott commented Jul 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment