Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parseGalleryMarkdown function typo #9681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ function saveThemeJson(cfg: pxt.TargetBundle, localDir?: boolean, packaged?: boo
targetStrings[k] = k;
const galleryUrl = getGalleryUrl(targetConfig.galleries[k])
const gallerymd = nodeutil.resolveMd(docsRoot, galleryUrl);
const gallery = pxt.gallery.parseGalleryMardown(gallerymd);
const gallery = pxt.gallery.parseGalleryMarkdown(gallerymd);
const gurl = `/${galleryUrl.replace(/^\//, '')}`;
tocmd +=
`* [${k}](${gurl})
Expand Down Expand Up @@ -3584,7 +3584,7 @@ export function downloadDiscourseTagAsync(parsed: commandParser.ParsedCommand):
let lastCard: pxt.CodeCard = undefined;
// parse existing cards
if (md) {
cards = pxt.gallery.parseGalleryMardown(md);
cards = pxt.gallery.parseGalleryMarkdown(md);
lastCard = cards.pop();
}
return pxt.discourse.topicsByTag(discourseRoot, tag)
Expand Down Expand Up @@ -5926,7 +5926,7 @@ function internalCheckDocsAsync(compileSnippets?: boolean, re?: string, fix?: bo
broken++;
return;
}
let gallery = pxt.gallery.parseGalleryMardown(gallerymd);
let gallery = pxt.gallery.parseGalleryMarkdown(gallerymd);
pxt.debug(`found ${gallery.length} galleries`);
gallery.forEach(gal => gal.cards.forEach((card, cardIndex) => {
pxt.debug(`card ${card.shortName || card.name}`);
Expand Down
2 changes: 1 addition & 1 deletion docs/translate/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Code highlights help to ephasize text that represents a block in the editor Tool
<0>||basic:show number||</0>
```

The `<0>` and `<0/>` are mardown escape codes and you leave them as is, at the same place in the string. The `||` are delimiters for this highlight extension and those are left alone too. The portion of it to the left of the `:`, which is `basic`, is the blocks category and it stays untranslated. The rest of it, `show number` relates to the block text and it does get translated. Typically, this will translate to the same text as the blocks in the `jsdoc` files.
The `<0>` and `<0/>` are markdown escape codes and you leave them as is, at the same place in the string. The `||` are delimiters for this highlight extension and those are left alone too. The portion of it to the left of the `:`, which is `basic`, is the blocks category and it stays untranslated. The rest of it, `show number` relates to the block text and it does get translated. Typically, this will translate to the same text as the blocks in the `jsdoc` files.

### Avatar sections

Expand Down
4 changes: 2 additions & 2 deletions pxtlib/gallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace pxt.gallery {
return !!cards?.length && cards;
}

export function parseGalleryMardown(md: string): Gallery[] {
export function parseGalleryMarkdown(md: string): Gallery[] {
if (!md) return [];

// second level titles are categories
Expand Down Expand Up @@ -242,7 +242,7 @@ namespace pxt.gallery {

export function loadGalleryAsync(name: string): Promise<Gallery[]> {
return pxt.Cloud.markdownAsync(name)
.then(md => parseGalleryMardown(md))
.then(md => parseGalleryMarkdown(md))
}

export function codeCardsToMarkdown(cards: pxt.CodeCard[]) {
Expand Down