Comply with noImplicitAny (#9940)

* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
This commit is contained in:
Michael Telatynski 2023-02-13 11:39:16 +00:00 committed by GitHub
parent ac7f69216e
commit 61a63e47f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
359 changed files with 1621 additions and 1353 deletions

View file

@ -77,8 +77,8 @@ export function htmlSerializeFromMdIfNeeded(md: string, { forceHTML = false } =
const orig = md;
if (SettingsStore.getValue("feature_latex_maths")) {
const patternNames = ["tex", "latex"];
const patternTypes = ["display", "inline"];
const patternNames = ["tex", "latex"] as const;
const patternTypes = ["display", "inline"] as const;
const patternDefaults = {
tex: {
// detect math with tex delimiters, inline: $...$, display $$...$$
@ -118,7 +118,7 @@ export function htmlSerializeFromMdIfNeeded(md: string, { forceHTML = false } =
patternTypes.forEach(function (patternType) {
// get the regex replace pattern from config or use the default
const pattern =
(((SdkConfig.get("latex_maths_delims") || {})[patternType] || {})["pattern"] || {})[patternName] ||
SdkConfig.get("latex_maths_delims")?.[patternType]?.["pattern"]?.[patternName] ||
patternDefaults[patternName][patternType];
md = md.replace(RegExp(pattern, "gms"), function (m, p1, p2) {