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

@bscotch/blork-shared

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscotch/blork-shared - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

2

dist/markdown.d.ts

@@ -13,3 +13,5 @@ export interface InlineMarkdownOptions {

allowHtml?: boolean;
/** If a link includes an origin, but not this one, render it as an anchor with target=_blank */
linkOutIfNotOrigin?: string;
}): string;
//# sourceMappingURL=markdown.d.ts.map

@@ -55,6 +55,17 @@ import { escapeHtml } from './html.js';

}
// Replace Markdown links with HTML links
html = html.replace(/\[([^\]]*?)\]\(([^)]*?)\)/g, `<a href="$2">$1</a>`);
const mdUrlPattern = /\[(?<content>[^\]]*?)\]\((?<url>[^)]*?)\)/g;
const matches = html.matchAll(mdUrlPattern);
for (const match of matches) {
const { content, url } = match.groups;
let anchorReplacement = `<a href="${url}"`;
if (options.linkOutIfNotOrigin &&
url.match(/^https?:/) &&
!url.startsWith(options.linkOutIfNotOrigin)) {
anchorReplacement += ` target="_blank"`;
}
anchorReplacement += `>${content}</a>`;
html = html.replaceAll(match[0], anchorReplacement);
}
return html + `</span>`;
}
//# sourceMappingURL=markdown.js.map

2

package.json
{
"name": "@bscotch/blork-shared",
"version": "0.12.0",
"version": "0.13.0",
"description": "Client and shared utilities for Blork projects.",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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