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

@financial-times/o-syntax-highlight

Package Overview
Dependencies
Maintainers
18
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/o-syntax-highlight - npm Package Compare versions

Comparing version 3.0.5 to 3.0.6

7

dist/js/syntax-highlight.js

@@ -79,5 +79,6 @@ "use strict";

_getLanguage(element) {
var className = element.className;
var highlightClassNames = [...element.classList].filter(c => c.includes('o-syntax-highlight--'));
var highlightClassName = highlightClassNames ? highlightClassNames[0] : null;
if (!className.includes('o-syntax-highlight--')) {
if (!highlightClassName) {
console.warn("In order to highlight a codeblock, the '<code>' " + "requires a specific class to define a language. E.g. " + "class=\"o-syntax-highlight--html\" or " + "class=\"o-syntax-highlight--js\"", element);

@@ -87,3 +88,3 @@ return null;

this.opts.language = className.replace('o-syntax-highlight--', '');
this.opts.language = highlightClassName.replace('o-syntax-highlight--', '');

@@ -90,0 +91,0 @@ this._checkLanguage();

@@ -28,3 +28,3 @@ {

"name": "@financial-times/o-syntax-highlight",
"version": "3.0.5",
"version": "3.0.6",
"description": "syntax highlighter for FT products",

@@ -31,0 +31,0 @@ "homepage": "https://github.com/Financial-Times/o-syntax-highlight",

@@ -55,6 +55,7 @@ import throwError from './helpers';

*/
_getLanguage (element) {
const className = element.className;
_getLanguage(element) {
const highlightClassNames = [...element.classList].filter(c => c.includes('o-syntax-highlight--'));
const highlightClassName = highlightClassNames ? highlightClassNames[0]: null;
if (!className.includes('o-syntax-highlight--')) {
if (!highlightClassName) {
console.warn(

@@ -68,3 +69,3 @@ `In order to highlight a codeblock, the '<code>' ` +

this.opts.language = className.replace('o-syntax-highlight--', '');
this.opts.language = highlightClassName.replace('o-syntax-highlight--', '');

@@ -71,0 +72,0 @@ this._checkLanguage();

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