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

nast-util-to-html

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

nast-util-to-html - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

1

dist/widgets/bookmark.d.ts
import Nast from 'notajs-types/nast';
/** !!! This should be replaced with more efficient implementation. */
declare function renderBookmark(node: Nast.WebBookmark): string;
export default renderBookmark;
//# sourceMappingURL=bookmark.d.ts.map

25

dist/widgets/bookmark.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const render_utils_1 = require("../render-utils");
/** !!! This should be replaced with more efficient implementation. */
function renderBookmark(node) {
let title = node.title ? node.title : '';
let link = node.link;
let titleHTML = node.title ? `<h5>${node.title}</h5>` : '';
let descHTML = node.description ? `<p>${node.description}</p>` : '';
let linkHTML = `<p>${node.link}</p>`;
let content = `\
<div style="display: flex;">
<div style="display: flex; text-align: left; overflow: hidden; border: 1px solid rgba(55, 53, 47, 0.16); border-radius: 0.7rem; position: relative; flex-grow: 1; color: rgb(55, 53, 47);">
<div style="min-height: 1rem; overflow: hidden; text-align: left; width: 100%;">
<a href="${link}" target="_blank" rel="noopener noreferrer" style="display: block; color: inherit; text-decoration: none;">
<div style="cursor: pointer; user-select: none; transition: background 120ms ease-in 0s; width: 100%; display: block; padding: 16px;">
<div style="font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">${title}</div>
<div style="font-size: 12px; display: flex; overflow: hidden; padding-top: 3px;">
<div style="font-size: 12px; min-width: 0px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${link}</div>
</div>
</div>
</a>
</div>
</div>
</div>`;
<a href="${node.link}">
${titleHTML}
${descHTML}
${linkHTML}
</a>`;
return render_utils_1.renderBlock(node, content);

@@ -24,0 +15,0 @@ }

{
"name": "nast-util-to-html",
"version": "0.2.3",
"version": "0.2.4",
"description": "Transform NAST to HTML.",

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

@@ -5,24 +5,15 @@ import Nast from 'notajs-types/nast'

/** !!! This should be replaced with more efficient implementation. */
function renderBookmark(
node: Nast.WebBookmark
): string {
let title = node.title ? node.title : ''
let link = node.link
let titleHTML = node.title ? `<h5>${node.title}</h5>` : ''
let descHTML = node.description ? `<p>${node.description}</p>` : ''
let linkHTML = `<p>${node.link}</p>`
let content = `\
<div style="display: flex;">
<div style="display: flex; text-align: left; overflow: hidden; border: 1px solid rgba(55, 53, 47, 0.16); border-radius: 0.7rem; position: relative; flex-grow: 1; color: rgb(55, 53, 47);">
<div style="min-height: 1rem; overflow: hidden; text-align: left; width: 100%;">
<a href="${link}" target="_blank" rel="noopener noreferrer" style="display: block; color: inherit; text-decoration: none;">
<div style="cursor: pointer; user-select: none; transition: background 120ms ease-in 0s; width: 100%; display: block; padding: 16px;">
<div style="font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">${title}</div>
<div style="font-size: 12px; display: flex; overflow: hidden; padding-top: 3px;">
<div style="font-size: 12px; min-width: 0px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${link}</div>
</div>
</div>
</a>
</div>
</div>
</div>`
<a href="${node.link}">
${titleHTML}
${descHTML}
${linkHTML}
</a>`
return renderBlock(node, content)

@@ -29,0 +20,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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