| | |
| | | _data = [_data] |
| | | } |
| | | } else if (_config.html) { |
| | | if (/\$blank_space_\d+\$/ig.test(_config.html)) { |
| | | _config.html = _config.html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | let n = +w.replace(/blank_space_|\$/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | if (_config.wrap.prefunc) { |
| | | let _html = '' |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('html', 'data', _config.wrap.prefunc) |
| | | _html = func(_config.html, {}) |
| | | } catch (e) { |
| | | _html = '' |
| | | console.warn(e) |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | _config.html = _html || _config.html |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | if (/\$blank_space_\d+\$/ig.test(item.$html)) { |
| | | item.$html = item.$html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | let n = +w.replace(/blank_space_|\$/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | if (wrap.prefunc) { |
| | | let _html = '' |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('html', 'data', wrap.prefunc) |
| | | _html = func(item.$html, item) |
| | | } catch (e) { |
| | | _html = '' |
| | | console.warn(e) |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | item.$html = _html || item.$html |
| | | } |
| | | // if (/\$blank_space_\d+\$/ig.test(item.$html)) { |
| | | // item.$html = item.$html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | // let n = +w.replace(/blank_space_|\$/ig, '') |
| | | // if (n) { |
| | | // return new Array(n).fill(' ').join('') |
| | | // } |
| | | |
| | | // return w |
| | | // }) |
| | | // } |
| | | } |
| | | }) |
| | | |
| | |
| | | /> : data.map((item, index) => <BraftContent |
| | | key={index} |
| | | value={item.$html} |
| | | script={config.wrap.loaded === 'true' ? config.wrap.loadedfunc : ''} |
| | | script={config.wrap.loadedfunc || ''} |
| | | />)} |
| | | </div> |
| | | ) |