Skip to content

Commit

Permalink
fix: make it possible to use EmbedLiveSample with sampleId in other t…
Browse files Browse the repository at this point in the history
…han en language mdn#4436
  • Loading branch information
Yury Shapkarin committed Aug 9, 2021
1 parent 9d0d255 commit d0c3939
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const { gather: gatherGitHistory } = require("./git-history");
const { buildSPAs } = require("./spas");
const { renderCache: renderKumascriptCache } = require("../kumascript");
const LANGUAGES_RAW = require("../content/languages.json");
const { safeDecodeURIComponent } = require("../kumascript/src/api/util");

const LANGUAGES = new Map(
Object.entries(LANGUAGES_RAW).map(([locale, data]) => {
Expand Down Expand Up @@ -630,7 +631,7 @@ async function buildLiveSamplePageFromURL(url) {
document.metadata.slug,
document.rawBody
)) {
if (sampleIDObject.id.toLowerCase() === sampleID) {
if (sampleIDObject.id.toLowerCase() === safeDecodeURIComponent(sampleID)) {
const liveSamplePage = kumascript.buildLiveSamplePage(
document.url,
document.metadata.title,
Expand Down

0 comments on commit d0c3939

Please sign in to comment.