chore(components): Handle escaped quotes for React render. See #437
This commit is contained in:
parent
d2bf45e63c
commit
508adb298e
2 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,7 @@ const Text = (props) => {
|
|||
for (let string of props.point.attributes.getAsArray('data-text')) {
|
||||
if (strings[props.language]['plugin.' + string])
|
||||
translated += strings[props.language]['plugin.' + string]
|
||||
else translated += string
|
||||
else translated += string.toString().replace(/"/g, '"')
|
||||
translated += ' '
|
||||
}
|
||||
// Handle muti-line text
|
||||
|
@ -18,13 +18,14 @@ const Text = (props) => {
|
|||
text.push(<tspan key={'tspan-' + key}>{lines.shift()}</tspan>)
|
||||
for (let line of lines) {
|
||||
key++
|
||||
console.log('multi', line, typeof line)
|
||||
text.push(
|
||||
<tspan
|
||||
key={'tspan-' + key}
|
||||
x={props.point.x}
|
||||
dy={props.point.attributes.get('data-text-lineheight') || 12}
|
||||
>
|
||||
{line}
|
||||
{line.toString().replace(/"/g, '"')}
|
||||
</tspan>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ const TextOnPath = (props) => {
|
|||
for (let string of props.path.attributes.getAsArray('data-text')) {
|
||||
if (strings[props.language]['plugin.' + string])
|
||||
translated += strings[props.language]['plugin.' + string]
|
||||
else translated += string
|
||||
else translated += string.toString().replace(/"/g, '"')
|
||||
translated += ' '
|
||||
}
|
||||
let textPathProps = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue