Replace whitespace in JSX text nodes with spaces
parent
8eb8527f94
commit
4d0fe4874e
3
index.js
3
index.js
|
@ -197,7 +197,8 @@ module.exports = function(babel)
|
||||||
let ru = getRegexp(state);
|
let ru = getRegexp(state);
|
||||||
if (ru.exec(path.node.value))
|
if (ru.exec(path.node.value))
|
||||||
{
|
{
|
||||||
const [ lwhite, text, rwhite ] = splitWhite(path.node.value);
|
let [ lwhite, text, rwhite ] = splitWhite(path.node.value);
|
||||||
|
text = text.replace(/\s{2,}|[\n\r\t]/g, ' ');
|
||||||
addImport(path);
|
addImport(path);
|
||||||
addString(path, text);
|
addString(path, text);
|
||||||
const repl = [];
|
const repl = [];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "babel-plugin-react-translate",
|
"name": "babel-plugin-react-translate",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Babel-based JS/JSX auto-translator for Russian language",
|
"description": "Babel-based JS/JSX auto-translator for Russian language",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue