0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 15:09:10 -05:00

Merge pull request #5357 from penpot/superalex-fix-generate-translation-files-with-markdown-and-links

🐛 Fix generate translation files with markdown and links
This commit is contained in:
Andrey Antukh 2024-11-25 11:18:13 +01:00 committed by GitHub
commit 6655563aba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -237,13 +237,18 @@ async function renderTemplate(path, context = {}, partials = {}) {
return mustache.render(content, context, partials); return mustache.render(content, context, partials);
} }
const renderer = { const extension = {
link(href, title, text) { useNewRenderer: true,
renderer: {
link(token) {
const href = token.href;
const text = token.text;
return `<a href="${href}" target="_blank">${text}</a>`; return `<a href="${href}" target="_blank">${text}</a>`;
}, },
},
}; };
marked.use({ renderer }); marked.use(extension);
async function readTranslations() { async function readTranslations() {
const langs = [ const langs = [