New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ebookr-acronym

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebookr-acronym - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

11

lib/acronym.js

@@ -28,2 +28,5 @@ var util = require('util');

});
ebookr.addParser('acp', function (text) {
return [text];
});
ebookr.addParser('acrodef', function (acronym, short, text) {

@@ -40,4 +43,12 @@ acronymHandler.addAcronym(acronym, short, text);

});
ebookr.addRenderer('acp', function (ac) {
var acronym = acronymHandler.getAcronym(ac);
var text = acronym.used
? util.format('<abbr title="%ss">%ss</abbr>', acronym.full, ac)
: util.format('%ss (%ss)', acronym.full, ac);
acronym.used = true;
return text;
});
return acronymHandler;
};

2

package.json
{
"name": "ebookr-acronym",
"version": "0.0.1",
"version": "0.0.2",
"description": "An extension to ebookr based on the popular LaTeX-package acronym",

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

@@ -23,2 +23,20 @@ var expect = require('chai').expect;

});
describe('Using <acp>', function () {
beforeEach(function () {
ebookr = require('ebookr').new();
acronym = require('../index')(ebookr);
ebookr.parse('<acrodef acronym="TLA">Three Letter Acronym</acrodef>');
});
it('should render', function () {
expect(ebookr.parse('<acp>TLA</acp>').render()).to.equal('Three Letter Acronyms (TLAs)');
});
it('should render differently when already used', function () {
expect(ebookr.parse('<acp>TLA</acp>\
<acp>TLA</acp>').render()).to.equal('Three Letter Acronyms (TLAs)\
<abbr title="Three Letter Acronyms">TLAs</abbr>');
});
});
});
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