Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix #1393
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 5, 2017
1 parent df494b4 commit c9f6ae1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/src/plugins/editor.diaporama/res/js/components.js
Expand Up @@ -25,13 +25,16 @@ import React, {Component} from 'react'
export class Image extends Component {
render() {
const {src, style, ...remainingProps} = this.props
let cleanSrc = src.replace(new RegExp("'", 'g') , "\\'");
cleanSrc = cleanSrc.replace(new RegExp("\\+", 'g') , encodeURIComponent("+"));
console.log(cleanSrc);

return (
<div
{...remainingProps}
style={{
...style,
backgroundImage: `url('${src}')`,
backgroundImage: `url('${cleanSrc}')`,
backgroundSize : "cover",
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat',
Expand Down
4 changes: 3 additions & 1 deletion core/src/plugins/editor.imagick/res/js/components.js
Expand Up @@ -25,13 +25,15 @@ import React, {Component} from 'react'
export class Image extends Component {
render() {
const {src, style, ...remainingProps} = this.props
let cleanSrc = src.replace(new RegExp("'", 'g') , "\\'");
cleanSrc = cleanSrc.replace(new RegExp("\\+", 'g') , encodeURIComponent("+"));

return (
<div
{...remainingProps}
style={{
...style,
backgroundImage: `url('${src}')`,
backgroundImage: `url('${cleanSrc}')`,
backgroundSize : "cover",
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat',
Expand Down

0 comments on commit c9f6ae1

Please sign in to comment.