Skip to content

Commit

Permalink
Merge pull request #8 from caub/inline
Browse files Browse the repository at this point in the history
Pass inline prop to block.markdown()
  • Loading branch information
powmedia authored Sep 22, 2022
2 parents c0eb255 + f048a86 commit 94300a6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dist/wurd-react.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ function WurdMarkdown({
block,
id, sid,
type = 'div', component: Component = type,
vars,
vars, inline,
...rest
}) {
block = block || wurd__default["default"].content;

const text = block.markdown(id, vars);
const text = block.markdown(id, vars, { inline });

const elProps = {
...rest,
Expand Down
4 changes: 2 additions & 2 deletions dist/wurd-react.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ function WurdMarkdown({
block,
id, sid,
type = 'div', component: Component = type,
vars,
vars, inline,
...rest
}) {
block = block || wurd.content;

const text = block.markdown(id, vars);
const text = block.markdown(id, vars, { inline });

const elProps = {
...rest,
Expand Down
7 changes: 5 additions & 2 deletions dist/wurd-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
return /*#__PURE__*/React__default["default"].createElement(Component, elProps, text);
}

var _excluded$3 = ["block", "id", "sid", "type", "component", "vars"];
var _excluded$3 = ["block", "id", "sid", "type", "component", "vars", "inline"];
function WurdMarkdown(_ref) {
var block = _ref.block,
id = _ref.id,
Expand All @@ -740,10 +740,13 @@
_ref$component = _ref.component,
Component = _ref$component === void 0 ? type : _ref$component,
vars = _ref.vars,
inline = _ref.inline,
rest = _objectWithoutProperties(_ref, _excluded$3);

block = block || instance.content;
var text = block.markdown(id, vars);
var text = block.markdown(id, vars, {
inline: inline
});

var elProps = _objectSpread2(_objectSpread2({}, rest), {}, {
dangerouslySetInnerHTML: {
Expand Down
2 changes: 1 addition & 1 deletion dist/wurd-react.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"@babel/core": "^7.19.0",
"@babel/preset-env": "^7.19.0",
"@babel/preset-react": "^7.18.6",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-eslint": "^8.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"eslint-plugin-react": "^7.31.7",
"mocha": "^10.0.0",
"rollup": "^2.79.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-uglify": "^6.0.4"
"rollup-plugin-terser": "^7.0.2"
},
"keywords": [
"cms",
Expand Down
12 changes: 6 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import filesize from 'rollup-plugin-filesize';
import { eslint } from 'rollup-plugin-eslint';
import eslint from '@rollup/plugin-eslint';
import pkg from './package.json';

export default [
Expand All @@ -30,7 +30,7 @@ export default [
globals: {
'react': 'React',
},
plugins: [uglify()],
plugins: [terser()],
}
],
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions src/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default function WurdMarkdown({
block,
id, sid,
type = 'div', component: Component = type,
vars,
vars, inline,
...rest
}) {
block = block || wurd.content;

const text = block.markdown(id, vars);
const text = block.markdown(id, vars, { inline });

const elProps = {
...rest,
Expand Down

0 comments on commit 94300a6

Please sign in to comment.