Fix whitespace handling in proxy

fix #49 & #45
This commit is contained in:
Standa Lukeš 2020-10-18 08:27:02 +00:00
parent 0f0994e7be
commit 8403dc832b
2 changed files with 2 additions and 1 deletions

View file

@ -161,6 +161,7 @@ function parseTaskStatuses(doc: HTMLDocument): TaskStatus[] {
const pointsMatch = /((|\.|\d)+) *\/ *(\d+)/.exec(pointsStr) const pointsMatch = /((|\.|\d)+) *\/ *(\d+)/.exec(pointsStr)
if (!pointsMatch) throw new Error() if (!pointsMatch) throw new Error()
let points = +pointsMatch[2] let points = +pointsMatch[2]
// points was a dash, means 0
if (isNaN(points)) { if (isNaN(points)) {
points = 0 points = 0
} }

View file

@ -16,7 +16,7 @@ namespace Ksp.WebServer
ModifyTree(document, context.Request.Path.Value.Trim('/')); ModifyTree(document, context.Request.Path.Value.Trim('/'));
var outputHtml = new StringWriter(); var outputHtml = new StringWriter();
document.ToHtml(outputHtml, new PrettyMarkupFormatter() { Indentation = "\t", NewLine = "\n" }); document.ToHtml(outputHtml, new HtmlMarkupFormatter());
return outputHtml.ToString(); return outputHtml.ToString();
} }