diff --git a/adev/shared-docs/pipeline/api-gen/rendering/marked/renderer.ts b/adev/shared-docs/pipeline/api-gen/rendering/marked/renderer.ts index a0206c0dcb3..d1cdf02d541 100644 --- a/adev/shared-docs/pipeline/api-gen/rendering/marked/renderer.ts +++ b/adev/shared-docs/pipeline/api-gen/rendering/marked/renderer.ts @@ -6,16 +6,16 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Renderer as MarkedRenderer, Tokens} from 'marked'; +import {Renderer, Tokens} from 'marked'; import {codeToHtml} from '../shiki/shiki'; /** * Custom renderer for marked that will be used to transform markdown files to HTML * files that can be used in the Angular docs. */ -export const renderer: Partial = { - code({lang, raw}): string { - const highlightResult = codeToHtml(raw, lang).replace(/>\s+<'); +export const renderer: Partial = { + code({lang, text}): string { + const highlightResult = codeToHtml(text, lang).replace(/>\s+<'); return `
@@ -33,22 +33,22 @@ export const renderer: Partial = { link({href, text}): string { return `${text}`; }, - list({items, ordered, start}) { + list(this: Renderer, {items, ordered, start}) { if (ordered) { return `
    - ${items} + ${items.map((item) => this.listitem(item)).join('')}
`; } return `
    - ${items} + ${items.map((item) => this.listitem(item)).join('')}
`; }, - table(this: MarkedRenderer, {header, rows}: Tokens.Table) { + table(this: Renderer, {header, rows}: Tokens.Table) { return `
diff --git a/adev/shared-docs/pipeline/guides/tranformations/text.ts b/adev/shared-docs/pipeline/guides/tranformations/text.ts index 65616fae6bb..b32e0dff862 100644 --- a/adev/shared-docs/pipeline/guides/tranformations/text.ts +++ b/adev/shared-docs/pipeline/guides/tranformations/text.ts @@ -15,8 +15,9 @@ const UNICODE_EMOJI_REGEX = /&#x[\dA-Fa-f]+;/g; /** Regex to find emojis. */ const regex = emojiRegex(); -export function textRender(this: Renderer, {text}: Tokens.Text) { - return regex.test(text) || UNICODE_EMOJI_REGEX.test(text) +export function textRender(this: Renderer, token: Tokens.Text) { + const text = token.tokens ? this.parser.parseInline(token.tokens) : token.text; + return regex.test(token.text) || UNICODE_EMOJI_REGEX.test(token.text) ? `${text}` : text; } diff --git a/packages/core/src/authoring/output/output.ts b/packages/core/src/authoring/output/output.ts index aa274f9cccd..f175550f2b1 100644 --- a/packages/core/src/authoring/output/output.ts +++ b/packages/core/src/authoring/output/output.ts @@ -33,8 +33,8 @@ export interface OutputOptions { * * To use `output()`, import the function from `@angular/core`. * - * ``` - * import {output} from '@angular/core`; + * ```ts + * import {output} from '@angular/core'; * ``` * * Inside your component, introduce a new class member and initialize