Skip to content

Commit

Permalink
Moved regex to top
Browse files Browse the repository at this point in the history
  • Loading branch information
drewwells committed Jul 27, 2011
1 parent f4d8e8e commit 90194e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/jodoc-lib.js
@@ -1,6 +1,11 @@
// a default html template
var default_template = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n<html lang="en">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n<title>$title</title>\n<meta name="generator" content="joDoc">\n<link rel="stylesheet" type="text/css" href="docbody.css">\n<link rel="stylesheet" type="text/css" href="doc.css">\n<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">\n<meta name="format-detection" content="false">\n</head>\n<body>\n$body\n</body>\n</html>';

var external_regex = /(\<a)\s+(href="(?:http[s]?|mailto|ftp))/g,
external_replace = '$1 class="external" $2',
link_leadin = /(\W+)/,
link_outtro = /(?!\<\/a|\w+)/;

// strip incoming text of comments
// input: "code"
// output: "comments"
Expand Down Expand Up @@ -179,12 +184,6 @@ function autolink(files,h1s,output) {
return files;
}

var external_regex = /(\<a)\s+(href="(?:http[s]?|mailto|ftp))/g;
var external_replace = '$1 class="external" $2';

var link_leadin = /(\W+)/;
var link_outtro = /(?!\<\/a|\w+)/;

function caseless_sort (a,b) {
if (typeof a !== "string" || typeof b !== "string") {
return 0;
Expand Down

0 comments on commit 90194e4

Please sign in to comment.