New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lib-react-components

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib-react-components - npm Package Compare versions

Comparing version 0.0.22 to 0.0.23

16

components/highlight_code/index.js

@@ -90,4 +90,18 @@ 'use strict';

var _html = _prismjs2.default.highlight(this.props.children, _prismjs2.default.languages[lang], lang);
var grammar = _prismjs2.default.languages[lang];
var _html = this.rootNode.textContent;
if (grammar) {
try {
_html = _prismjs2.default.highlight(_html, grammar, lang);
} catch (err) {
console.warn('React Components Highlighter: There is an error highlighting lang ' + lang, err);
}
} else {
_html = _html.replace(/[<>]/g, function (s) {
return '&#' + s.charCodeAt(0) + ';';
});
}
// Treat iOS whie-space: pre; behavior
this.rootNode.innerHTML = _html.replace(/\n/g, '<br>').replace(/<br>[ ]+/g, function (str) {

@@ -94,0 +108,0 @@ return '<br>' + '&nbsp;'.repeat(str.length - 5);

@@ -57,4 +57,16 @@ import React, { Component } from 'react';

const { lang } = this.props;
const _html = Prism.highlight(this.props.children, Prism.languages[lang], lang);
const grammar = Prism.languages[lang];
let _html = this.rootNode.textContent;
if (grammar) {
try {
_html = Prism.highlight(_html, grammar, lang);
} catch (err) {
console.warn(`React Components Highlighter: There is an error highlighting lang ${lang}`, err);
}
} else {
_html = _html.replace(/[<>]/g, s => `&#${s.charCodeAt(0)};`);
}
// Treat iOS whie-space: pre; behavior
this.rootNode.innerHTML = _html

@@ -61,0 +73,0 @@ .replace(/\n/g, '<br>')

2

package.json
{
"name": "lib-react-components",
"version": "0.0.22",
"version": "0.0.23",
"description": "React components",

@@ -5,0 +5,0 @@ "keywords": [

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