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

rebber

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rebber - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

22

dist/types/image.js

@@ -20,2 +20,24 @@ 'use strict';

/*
LaTeX cannot handle remote images, only local ones.
\includegraphics crashes with filenames that contain more than one `.`,
the workaround is \includegraphics{/path/to/{image.foo}.jpg}
*/
if (node.url) {
var pathParts = node.url.split('/');
var filename = pathParts.pop();
if (filename.includes('.')) {
var filenameParts = filename.split('.');
var extension = filenameParts.pop();
var basename = filenameParts.join('.');
var safeBasename = basename.includes('.') ? '{' + basename + '}.' + extension : basename + '.' + extension;
pathParts.push(safeBasename);
node.url = '' + pathParts.join('/');
}
}
var macro = options.image ? options.image : defaultMacro;

@@ -22,0 +44,0 @@ if (parent.type === 'paragraph' && parent.children.length - 1) {

2

package.json
{
"name": "rebber",
"version": "2.0.5",
"version": "2.1.0",
"description": "Stringifies MDAST to LaTeX",

@@ -5,0 +5,0 @@ "repository": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/rebber",

@@ -18,2 +18,26 @@ /* Expose. */

/*
LaTeX cannot handle remote images, only local ones.
\includegraphics crashes with filenames that contain more than one `.`,
the workaround is \includegraphics{/path/to/{image.foo}.jpg}
*/
if (node.url) {
const pathParts = node.url.split('/')
const filename = pathParts.pop()
if (filename.includes('.')) {
const filenameParts = filename.split('.')
const extension = filenameParts.pop()
const basename = filenameParts.join('.')
const safeBasename = basename.includes('.')
? `{${basename}}.${extension}`
: `${basename}.${extension}`
pathParts.push(safeBasename)
node.url = `${pathParts.join('/')}`
}
}
let macro = options.image ? options.image : defaultMacro

@@ -20,0 +44,0 @@ if (parent.type === 'paragraph' && parent.children.length - 1) {

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