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

vue-highlightjs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-highlightjs - npm Package Compare versions

Comparing version 1.2.3 to 1.3.1

1

.eslintrc.js

@@ -8,3 +8,4 @@ module.exports = {

"strict": [0, "global"],
"no-var": "off"
}
};

25

index.js
'use strict';
const hljs = require('highlight.js');
var hljs = require('highlight.js');
const vueHighlightJS = {};
var vueHighlightJS = {};
vueHighlightJS.install = function install(Vue) {

@@ -11,7 +11,10 @@ Vue.directive('highlightjs', {

// on first bind, highlight all targets
const targets = el.querySelectorAll('code');
for (var i = 0; i < targets.length; i += 1) {
const target = targets[i];
var targets = el.querySelectorAll('code');
var target;
var i;
if (binding.value) {
for (i = 0; i < targets.length; i += 1) {
target = targets[i];
if (typeof binding.value === 'string') {
// if a value is directly assigned to the directive, use this

@@ -27,7 +30,9 @@ // instead of the element content.

// after an update, re-fill the content and then highlight
const targets = el.querySelectorAll('code');
var targets = el.querySelectorAll('code');
var target;
var i;
for (var i = 0; i < targets.length; i += 1) {
const target = targets[i];
if (binding.value) {
for (i = 0; i < targets.length; i += 1) {
target = targets[i];
if (typeof binding.value === 'string') {
target.textContent = binding.value;

@@ -34,0 +39,0 @@ hljs.highlightBlock(target);

{
"name": "vue-highlightjs",
"version": "1.2.3",
"version": "1.3.1",
"description": "Syntax highlighting with highlight.js for Vue.js 2.x",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/metachris/vue-highlightjs",

@@ -55,5 +55,6 @@ [Vue.js](https://vuejs.org/) syntax highlighting made easy, using [highlight.js](https://highlightjs.org/).

* Chris Hager
* [Chris Hager](https://www.metachris.com)
* [mr-krille](https://github.com/mr-krille)
* [Duoc Nguyen](https://github.com/nguyenvanduocit)
* [Shu Ding](https://github.com/shudin)

@@ -63,4 +64,9 @@

v1.3.1
* Changed `const` to `var` for compatibility with PhantomJS and UglifyJS
* [Bugfix](https://github.com/metachris/vue-highlightjs/pull/6) to allow empty content
v1.2.2
* Fixed displaying and highlighting HTML tags passed as value to the directive (thanks @nguyenvanduocit)
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