Browse files

DOC: Handle quote sets and escape periods.

  • Loading branch information...
1 parent db35fbf commit 4ced96dffa570d4efd03771112e711e4f803cb4a @njsmith njsmith committed with jseabold Jul 6, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 docs/source/_static/scripts.js
View
6 docs/source/_static/scripts.js
@@ -16,7 +16,7 @@ return codebox;
function cleanQuotes(text){
/// Replace all single and double quotes with one escaped backslash
- return text.replace(/["|']/g, "\\'");
+ return text.replace(/(["'])/g, "\\\1");
}
function scrapeText(codebox){
@@ -27,8 +27,8 @@ function scrapeText(codebox){
if (this.match(/^In \[\d+]: /)){
newlines.push(cleanQuotes(this.replace(/^(\s)*In \[\d+]: /,"")));
}
- else if (this.match(/^(\s)*.+:/)){
- newlines.push(cleanQuotes(this.replace(/^(\s)*.+: /,"")));
+ else if (this.match(/^(\s)*\.+:/)){
+ newlines.push(cleanQuotes(this.replace(/^(\s)*\.+: /,"")));
}
}

0 comments on commit 4ced96d

Please sign in to comment.