Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

article-json-html-render

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

article-json-html-render - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

3

dist/block-list.js

@@ -41,3 +41,4 @@ 'use strict';

var children = _ref3.children;
return (0, _magicVirtualElement2.default)(Blockquote, { items: children });
var pullQuote = _ref3.pullQuote;
return (0, _magicVirtualElement2.default)(Blockquote, { items: children, pullQuote: pullQuote });
},

@@ -44,0 +45,0 @@ embed: function embed(item) {

@@ -17,6 +17,8 @@ 'use strict';

render: function render(_ref2) {
var items = _ref2.props.items;
var _ref2$props = _ref2.props;
var items = _ref2$props.items;
var pullQuote = _ref2$props.pullQuote;
return (0, _magicVirtualElement2.default)(
'blockquote',
null,
{ 'class': pullQuote && 'q' },
blockList(items)

@@ -23,0 +25,0 @@ );

@@ -13,3 +13,3 @@ import element from 'magic-virtual-element';

const types = {
blockquote: ({children}) => <Blockquote items={children} />,
blockquote: ({children, pullQuote}) => <Blockquote items={children} pullQuote={pullQuote} />,
embed: item => Embed.test(item) ? <Embed {...item} /> : '',

@@ -16,0 +16,0 @@ header1: ({children}) => <Header level={1} items={children} />,

import element from 'magic-virtual-element';
const setup = ({blockList}) => ({
render: ({props: {items}}) => <blockquote>{blockList(items)}</blockquote>
render: ({props: {items, pullQuote}}) => <blockquote class={pullQuote && 'q'}>{blockList(items)}</blockquote>
});
export default setup;
{
"name": "article-json-html-render",
"version": "2.5.0",
"version": "2.6.0",
"description": "Base for html-based article-json renderer, such as [article-json-to-amp](https://www.npmjs.com/package/article-json-to-amp)",

@@ -33,3 +33,3 @@ "main": "dist/index.js",

"semistandard-deku": "micnews/semistandard#deku",
"snazzy": "^4.0.0",
"snazzy": "^5.0.0",
"tape": "^4.4.0"

@@ -36,0 +36,0 @@ },

@@ -199,2 +199,3 @@ import test from 'tape';

type: 'blockquote',
pullQuote: false,
children: [{

@@ -229,2 +230,36 @@ type: 'paragraph',

test('blockquote pullQuote=true', t => {
const Article = setupArticle({embeds: {}});
const items = [{
type: 'blockquote',
pullQuote: true,
children: [{
type: 'paragraph',
children: [{
type: 'text',
content: 'abc'
}]
}, {
type: 'paragraph',
children: [{
type: 'text',
content: 'def',
bold: true
}]
}]
}];
const actual = renderString(tree(<Article items={items} />));
const expected = renderString(tree(
<article>
<blockquote class='q'>
<p>abc</p>
<p><b>def</b></p>
</blockquote>
</article>
));
t.equal(actual, expected);
t.end();
});
test('unkown type', t => {

@@ -231,0 +266,0 @@ const Article = setupArticle({embeds: {}});

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc