Skip to content

Commit

Permalink
added renderValidation to renderer to remove validation tags in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srietkerk committed Apr 12, 2024
1 parent 853eec8 commit e676aa6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pxtrunner/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,19 @@ function renderBlockConfig(options: ClientRenderOptions) {
render("global");
}

function renderValidation(options: ClientRenderOptions) {
function render(scope: "local" | "global") {
$(`code.lang-validation\\.${scope}`).each((i, c) => {
let $c = $(c);
if (options.snippetReplaceParent)
$c = $c.parent();
$c.remove();
});
}
render("local");
render("global");
}

function renderSims(options: ClientRenderOptions) {
if (!options.simulatorClass) return;
// simulators
Expand Down Expand Up @@ -1313,6 +1326,7 @@ export function renderAsync(options?: ClientRenderOptions): Promise<void> {
renderQueue = [];
renderGhost(options);
renderBlockConfig(options);
renderValidation(options);
renderSims(options);
renderTypeScript(options);
renderDirectPython(options);
Expand Down

0 comments on commit e676aa6

Please sign in to comment.