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

kramed

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kramed - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

lib/lex/html_blocks.js

15

lib/lex/inline.js

@@ -8,2 +8,3 @@ var _utils = require('../utils');

var defaultOptions = require('./options');
var isHTMLBlock = require('./html_blocks');

@@ -110,8 +111,10 @@ /**

if (cap = this.rules.html.exec(src)) {
// Found a paragraph
if(cap[1] === 'p' && cap[2]) {
// Found a link
if(cap[1] === 'a' && cap[2] && !this.inLink) {
// Opening tag
out += cap[0].substring(0, cap[0].indexOf(cap[2]));
this.inLink = true;
// In between the tag
out += this.output(cap[2]);
this.inLink = false;
// Outer tag

@@ -124,10 +127,8 @@ out += cap[0].substring(cap[0].indexOf(cap[2])+cap[2].length);

// Found a link
if(cap[1] === 'a' && cap[2] && !this.inLink) {
// Found HTML that we should parse
if(!isHTMLBlock(cap[1]) && cap[2]) {
// Opening tag
out += cap[0].substring(0, cap[0].indexOf(cap[2]));
this.inLink = true;
// In between the tag
out += this.output(cap[2]);
this.inLink = false;
// Outer tag

@@ -139,3 +140,3 @@ out += cap[0].substring(cap[0].indexOf(cap[2])+cap[2].length);

}
// Any other HTML

@@ -142,0 +143,0 @@ src = src.substring(cap[0].length);

@@ -14,3 +14,3 @@ var _utils = require('../utils');

url: noop,
html: /^<!--[\s\S]*?-->|^<(\w+(?!:\/|[^\w\s@]*@)\b)*?(?:"[^"]*"|'[^']*'|[^'">])*?>([\s\S]+)?<\/\1>|^<(\w+(?!:\/|[^\w\s@]*@)\b)(?:"[^"]*"|'[^']*'|[^'">])*?>/,
html: /^<!--[\s\S]*?-->|^<(\w+(?!:\/|[^\w\s@]*@)\b)*?(?:"[^"]*"|'[^']*'|[^'">])*?>([\s\S]*?)?<\/\1>|^<(\w+(?!:\/|[^\w\s@]*@)\b)(?:"[^"]*"|'[^']*'|[^'">])*?>/,
link: /^!?\[(inside)\]\(href\)/,

@@ -17,0 +17,0 @@ reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,

@@ -5,3 +5,3 @@ {

"author": "Aaron O'Mullan",
"version": "0.5.3",
"version": "0.5.4",
"main": "./lib/kramed.js",

@@ -8,0 +8,0 @@ "bin": "./bin/kramed",

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