build: fix crowdin build for admonition syntax
This commit is contained in:
Родитель
5efd4d770d
Коммит
adf029c3cb
|
@ -93,6 +93,18 @@ const newLineOnHTMLComment = (line) => {
|
|||
return line;
|
||||
};
|
||||
|
||||
/**
|
||||
* Crowdin translations also happen to break
|
||||
* Docusaurus' MDX admonition syntax.
|
||||
* @param {string} line
|
||||
*/
|
||||
const newLineOnAdmonition = (line) => {
|
||||
if (line.endsWith(':::') && !line.startsWith(':::')) {
|
||||
return line.replace(':::', ':::\n');
|
||||
}
|
||||
return line;
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies any transformation that can be executed line by line on
|
||||
* the document to make sure it is ready to be consumed by
|
||||
|
@ -108,6 +120,7 @@ const transform = (doc) => {
|
|||
apiTransformer,
|
||||
fiddleTransformer,
|
||||
newLineOnHTMLComment,
|
||||
newLineOnAdmonition,
|
||||
];
|
||||
|
||||
for (const line of lines) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче