v1.5.6
This release is based on Asciidoctor 1.5.6.2 and Opal 0.11.1.dev (ceda559).
As a reminder, Asciidoctor.js now provides different builds for different JS environments:
Environment | File |
---|---|
Browser | dist/browser/asciidoctor.js |
Node/Electron | dist/node/asciidoctor.js |
Nashorn | dist/nashorn/asciidoctor.js |
UMD | dist/umd/asciidoctor.js |
For backward compatibility, dist/asciidoctor.js
and dist/asciidoctor.min.js
are still available.
Changelog
Includes everything from 1.5.6-rc.1 and more!
Bug fixes
- Fix failure when retrieving extension groups when none have been defined (#434)
- Fix
Extensions#unregister
when names are passed as array (#469)
Improvements
- Include directive is now working on
http
andhttps
URI in a Node.js environment (#472)
const opts = {
safe: 'safe',
attributes: {'allow-uri-read': true}
};
const html = asciidoctor.convert('include::https://raw.com/document.adoc[tag=intro]', opts);
- Update to Opal 0.11.1.dev@ceda559 (#472)
- Return
undefined
if the subtitle isOpal.nil
(#473) - Core API: Map
AbstractNode#getParent
(#461)
const doc = asciidoctor.load('= Document Title\n\ncontent', options);
console.log(doc.getParent()); // undefined
console.log(doc.getBlocks()[0].getParent()) // the parent doc
- Core API: Map substitution methods on
AbstractBlock
(#462)
const source = '----\nverbatim <1>\n----\n<1> verbatim text';
const listingBlock = asciidoctor.load(source).findBy({ context: 'listing' })[0];
// getSubstitutions
console.log(listingBlock.getSubstitutions()); // ['specialcharacters', 'callouts']
// hasSubstitution
console.log(listingBlock.hasSubstitution('callouts')); // true
console.log(listingBlock.hasSubstitution('macros')); // false
// removeSubstitution
listingBlock.removeSubstitution('callouts');
console.log(listingBlock.hasSubstitution('callouts')); // false
const source = '----\nverbatim <1>\n----\n<1> verbatim text';
const listingBlock = asciidoctor.load(source).findBy({ context: 'listing' })[0];
console.log(listingBlock.getSubstitutions()); // ['specialcharacters', 'callouts']
- Extension API: Map method to register block on multiple contexts (#465)
asciidoctor.Extensions.register(function () {
this.block(function () {
this.named('cloak');
this.onContexts('paragraph', 'literal');
this.process((parent, reader, attrs) => {
return this.createBlock(parent, 'paragraph', 'cloaked: ' + Opal.hash_get(attrs, 'cloaked-context'));
});
});
});
Release Meta
Released on: 2018-04-17
Released by: @Mogztter
Published by: Travis!