Usage of special HTML chars in mardown fix
This commit is contained in:
parent
f9d0954261
commit
c56f80cc22
@ -98,7 +98,7 @@ export const loadModuleMarkdownDescription = (http: HttpClient, translate: Trans
|
|||||||
} else {
|
} else {
|
||||||
propDescription += `<p class="!pl-4 !pr-4"><em>const</em> <strong>${propName}</strong>: <code>${type}</code>`;
|
propDescription += `<p class="!pl-4 !pr-4"><em>const</em> <strong>${propName}</strong>: <code>${type}</code>`;
|
||||||
if (type !== 'object') {
|
if (type !== 'object') {
|
||||||
propDescription += ` = ${prop}`;
|
propDescription += ` = ${type === 'string' ? handleHtmlSpecialChars(prop) : prop}`;
|
||||||
}
|
}
|
||||||
propDescription += '</p>';
|
propDescription += '</p>';
|
||||||
}
|
}
|
||||||
@ -133,6 +133,10 @@ export const loadModuleMarkdownDescription = (http: HttpClient, translate: Trans
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleHtmlSpecialChars = (text: string): string => {
|
||||||
|
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
}
|
||||||
|
|
||||||
export const loadModuleMarkdownSourceCode = (http: HttpClient, translate: TranslateService, resource: ResourceInfo): Observable<string> => {
|
export const loadModuleMarkdownSourceCode = (http: HttpClient, translate: TranslateService, resource: ResourceInfo): Observable<string> => {
|
||||||
let sourceCode = `<div class="flex flex-col !pl-4"><h6>${resource.title}</h6><small>${translate.instant('js-func.source-code')}</small></div>\n\n`;
|
let sourceCode = `<div class="flex flex-col !pl-4"><h6>${resource.title}</h6><small>${translate.instant('js-func.source-code')}</small></div>\n\n`;
|
||||||
return loadFunctionModuleSource(http, resource.link).pipe(
|
return loadFunctionModuleSource(http, resource.link).pipe(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user