summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-09-18 13:08:38 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-09-18 13:08:38 -0400
commitebe41180c41f544919c03fb3bf6029437a7d65a4 (patch)
tree0c5c0602bbee1fc96a024f3be1cd225d72d37fa0 /src/SMAPI.Web
parentc5b8cd626489dad6210fe629658314dfc85f4d08 (diff)
parent6643da4574bec2d71ac9c25a2c9ab15b8c855e2b (diff)
downloadSMAPI-ebe41180c41f544919c03fb3bf6029437a7d65a4.tar.gz
SMAPI-ebe41180c41f544919c03fb3bf6029437a7d65a4.tar.bz2
SMAPI-ebe41180c41f544919c03fb3bf6029437a7d65a4.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web')
-rw-r--r--src/SMAPI.Web/Controllers/JsonValidatorController.cs26
-rw-r--r--src/SMAPI.Web/Views/Mods/Index.cshtml4
2 files changed, 18 insertions, 12 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs
index c77a3036..e06c1236 100644
--- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs
+++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs
@@ -90,21 +90,27 @@ namespace StardewModdingAPI.Web.Controllers
// parse JSON
JToken parsed;
- try
{
- parsed = JToken.Parse(file.Content, new JsonLoadSettings
+ // load raw JSON
+ var settings = new JsonLoadSettings
{
DuplicatePropertyNameHandling = DuplicatePropertyNameHandling.Error,
CommentHandling = CommentHandling.Load
- });
- }
- catch (JsonReaderException ex)
- {
- return this.View("Index", result.AddErrors(new JsonValidatorErrorModel(ex.LineNumber, ex.Path, ex.Message, ErrorType.None)));
- }
+ };
+ try
+ {
+ parsed = JToken.Parse(file.Content, settings);
+ }
+ catch (JsonReaderException ex)
+ {
+ return this.View("Index", result.AddErrors(new JsonValidatorErrorModel(ex.LineNumber, ex.Path, ex.Message, ErrorType.None)));
+ }
- // format JSON
- result.SetContent(parsed.ToString(Formatting.Indented), expiry: file.Expiry, uploadWarning: file.Warning);
+ // format JSON
+ string formatted = parsed.ToString(Formatting.Indented);
+ result.SetContent(formatted, expiry: file.Expiry, uploadWarning: file.Warning);
+ parsed = JToken.Parse(formatted); // update line number references
+ }
// skip if no schema selected
if (schemaName == "none")
diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml
index 7dcd0718..5df49afb 100644
--- a/src/SMAPI.Web/Views/Mods/Index.cshtml
+++ b/src/SMAPI.Web/Views/Mods/Index.cshtml
@@ -45,7 +45,7 @@ else
@if (hasBeta)
{
- <p id="beta-blurb" v-show="showAdvanced"><strong>Note:</strong> "@betaLabel" lines are for an unreleased version of SMAPI, not the stable version most players have. If a mod doesn't have that line, the info applies to both versions of SMAPI.</p>
+ <p id="beta-blurb"><strong>Note:</strong> "@betaLabel" lines are for the beta version of Stardew Valley, not the stable version most players have. If a mod doesn't have that line, the info applies to both versions.</p>
}
</div>
@@ -99,7 +99,7 @@ else
</td>
<td>
<div v-html="mod.Compatibility.Summary"></div>
- <div v-if="mod.BetaCompatibility" v-show="showAdvanced">
+ <div v-if="mod.BetaCompatibility">
<strong v-if="mod.BetaCompatibility">@betaLabel:</strong>
<span v-html="mod.BetaCompatibility.Summary"></span>
</div>