diff --git a/src/db/query_builder.go b/src/db/query_builder.go index 1f794c92..80a687f0 100644 --- a/src/db/query_builder.go +++ b/src/db/query_builder.go @@ -14,9 +14,9 @@ type QueryBuilder struct { Adds the given SQL and arguments to the query. Any occurrences of `$?` will be replaced with the correct argument number. -foo $? bar $? baz $? -foo ARG1 bar ARG2 baz $? -foo ARG1 bar ARG2 baz ARG3 + foo $? bar $? baz $? + foo ARG1 bar ARG2 baz $? + foo ARG1 bar ARG2 baz ARG3 */ func (qb *QueryBuilder) Add(sql string, args ...interface{}) { numPlaceholders := strings.Count(sql, "$?") diff --git a/src/hmnurl/hmnurl_test.go b/src/hmnurl/hmnurl_test.go index 2832c92b..77dba56b 100644 --- a/src/hmnurl/hmnurl_test.go +++ b/src/hmnurl/hmnurl_test.go @@ -298,12 +298,12 @@ func TestProjectCSS(t *testing.T) { AssertRegexMatch(t, BuildProjectCSS("000000"), RegexProjectCSS, nil) } -func TestEditorPreviewsJS(t *testing.T) { - AssertRegexMatch(t, BuildEditorPreviewsJS(), RegexEditorPreviewsJS, nil) +func TestMarkdownWorkerJS(t *testing.T) { + AssertRegexMatch(t, BuildMarkdownWorkerJS(), RegexMarkdownWorkerJS, nil) } func TestAPICheckUsername(t *testing.T) { - AssertRegexmatch(t, BuildAPICheckUsername(), RegexAPICheckUsername, nil) + AssertRegexMatch(t, BuildAPICheckUsername(), RegexAPICheckUsername, nil) } func TestPublic(t *testing.T) { diff --git a/src/hmnurl/urls.go b/src/hmnurl/urls.go index dfb8cc96..4e8e8ba3 100644 --- a/src/hmnurl/urls.go +++ b/src/hmnurl/urls.go @@ -702,11 +702,11 @@ func BuildProjectCSS(color string) string { return Url("/assets/project.css", []Q{{"color", color}}) } -var RegexEditorPreviewsJS = regexp.MustCompile("^/assets/editorpreviews.js$") +var RegexMarkdownWorkerJS = regexp.MustCompile("^/assets/markdown_worker.js$") -func BuildEditorPreviewsJS() string { +func BuildMarkdownWorkerJS() string { defer CatchPanic() - return Url("/assets/editorpreviews.js", nil) + return Url("/assets/markdown_worker.js", nil) } var RegexS3Asset *regexp.Regexp diff --git a/src/templates/src/editor.html b/src/templates/src/editor.html index 6bf59370..580f6d98 100644 --- a/src/templates/src/editor.html +++ b/src/templates/src/editor.html @@ -1,11 +1,9 @@ {{ template "base.html" . }} {{ define "extrahead" }} - + {{ template "markdown_previews.html" . }} + - {{ end }} {{ define "content" }} -