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

lys-markdown-parser

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lys-markdown-parser - npm Package Compare versions

Comparing version 3.5.1 to 3.6.0

2

package.json
{
"name": "lys-markdown-parser",
"version": "3.5.1",
"version": "3.6.0",
"description": "js markdown parser",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -16,2 +16,8 @@ /**

function removeAllChildren(element) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
/**

@@ -89,4 +95,21 @@ * AST 转 dom

case nodeType.text: {
const text = node.value;
ele = document.createTextNode(text);
// const text = node.value;
// ele = document.createTextNode(text);
ele = document.createElement('span');
ele.setAttribute('md-type', 'text-node');
node.__update = (key, newNode) => {
removeAllChildren(ele);
// 对纯文本节点做链接提取,提升用户体验
newNode[key].split(/([A-z]+:\/{2}\S+)/g).forEach((i, index) => {
if (index % 2 === 1) {
const a = document.createElement('a');
a.href = i;
a.textContent = i;
ele.appendChild(a);
} else {
ele.appendChild(document.createTextNode(i));
}
});
};
node.__update('value', node);
break;

@@ -93,0 +116,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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