mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
Fix translation functionality to properly condense whitespace and parse escaped characters (#17)
This commit is contained in:
parent
70ed75b046
commit
523d824651
3 changed files with 18 additions and 3 deletions
|
@ -19,7 +19,7 @@ module.exports = function translatePlugin(babel) {
|
|||
return;
|
||||
}
|
||||
/* assume translate element only has one child which is the text */
|
||||
const text = path.node.children[0].value.trim();
|
||||
const text = path.node.children[0].value.trim().replace(/\s+/g, " ");
|
||||
let description = "no description given";
|
||||
const attributes = path.node.openingElement.attributes;
|
||||
for (let i = 0; i < attributes.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue