A few more fixes following the big cleanup.

This commit is contained in:
mtail 2019-02-10 15:44:06 -08:00
parent 6f7fa1445f
commit efdae03b36
18 changed files with 36 additions and 24 deletions

View File

@ -1,4 +1,4 @@
{{- /* Inserts a text block into the HTML. See https://preliminary.istio.io/about/contribute/writing-a-new-topic/#embedding-preformatted-blocks for details */ -}} {{- /* Inserts a text block into the HTML. See https://preliminary.istio.io/about/contribute/creating-and-editing-pages/#embedding-preformatted-blocks for details */ -}}
{{- $downloadas := "" -}} {{- $downloadas := "" -}}
{{- if .Get 2 -}} {{- if .Get 2 -}}
{{- $downloadas = .Get 2 -}} {{- $downloadas = .Get 2 -}}
@ -44,9 +44,6 @@
{{- if eq $syntax "bash" -}} {{- if eq $syntax "bash" -}}
{{- if not (hasPrefix $text "$") -}} {{- if not (hasPrefix $text "$") -}}
{{- errorf "Text block specifies a bash syntax, but the first line of the block does not start with $ (%s)" .Position -}} {{- errorf "Text block specifies a bash syntax, but the first line of the block does not start with $ (%s)" .Position -}}
{{- else -}}
{{- if findRE "<<EOF" $line0 -}}
{{- $text = substr $text 2 -}}
{{- else -}} {{- else -}}
{{- $syntax = "command" -}} {{- $syntax = "command" -}}
{{- if $output -}} {{- if $output -}}
@ -54,7 +51,6 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- /* include a link to the special embedded @@ references so the links are statically checked as we build the site */ -}} {{- /* include a link to the special embedded @@ references so the links are statically checked as we build the site */ -}}
{{- $branch := .Site.Data.args.source_branch_name -}} {{- $branch := .Site.Data.args.source_branch_name -}}

View File

@ -1,4 +1,4 @@
{{- /* Inserts a text file into the HTML. See https://preliminary.istio.io/about/contribute/writing-a-new-topic/#embedding-preformatted-blocks for details */ -}} {{- /* Inserts a text file into the HTML. See https://preliminary.istio.io/about/contribute/creating-and-editing-pages/#embedding-preformatted-blocks for details */ -}}
{{- $name := split (.Get "file") "/" | last 1 -}} {{- $name := split (.Get "file") "/" | last 1 -}}
{{- $downloadas := index $name 0 -}} {{- $downloadas := index $name 0 -}}
{{- if .Get "downloadas" -}} {{- if .Get "downloadas" -}}

View File

@ -186,7 +186,7 @@ function handleDOMLoaded() {
var text = getToolbarDivText(div); var text = getToolbarDivText(div);
var downloadas = code.getAttribute("data-downloadas"); var downloadas = code.getAttribute("data-downloadas");
if (downloadas === null || downloadas === "") { if (downloadas === null || downloadas === "") {
downloadas = "foo.txt"; downloadas = "foo";
var lang = ""; var lang = "";
for (var j = 0; j < code.classList.length; j++) { for (var j = 0; j < code.classList.length; j++) {
@ -283,6 +283,7 @@ function handleDOMLoaded() {
var lines = code.innerText.split("\n"); var lines = code.innerText.split("\n");
var cmd = ""; var cmd = "";
var escape = false; var escape = false;
var escapeUntilEOF = false;
var tmp = ""; var tmp = "";
for (var j = 0; j < lines.length; j++) { for (var j = 0; j < lines.length; j++) {
var line = lines[j]; var line = lines[j];
@ -293,9 +294,22 @@ function handleDOMLoaded() {
} }
tmp = line.slice(2); tmp = line.slice(2);
if (line.endsWith("<<EOF")) {
escapeUntilEOF = true;
}
} else if (escape) { } else if (escape) {
// continuation // continuation
tmp += "\n" + line; tmp += "\n" + line;
if (line.endsWith("<<EOF")) {
escapeUntilEOF = true;
}
} else if (escapeUntilEOF) {
tmp += "\n" + line;
if (line === "EOF") {
escapeUntilEOF = false;
}
} else { } else {
outputStart = j; outputStart = j;
break; break;

View File

@ -207,6 +207,8 @@ pre {
} }
div.toolbar { div.toolbar {
position: relative;
button { button {
font-size: .8em; font-size: .8em;
padding: 0 .5em; padding: 0 .5em;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long