This document provides a high-level view of the changes introduced in Asciidoctor.js by release. For a detailed view of what has changed, refer to the commit history on GitHub.
- Bug Fixes
-
-
Default condition should be last one in conditional exports otherwise the following error is thrown: "Module not found: Error: Default condition should be last one" (#1722) - thanks @roseckyj & @korva
-
- Infrastructure
-
-
Update development dependencies
-
- Bug Fixes
-
-
Fix types exports in
package.json- thanks @sinedied -
Addd
contextandnode_nameaccessor in the type definition - thanks @RayOffiah
-
- Infrastructure
-
-
Update development dependencies
-
- Breaking Changes
-
-
Remove
Asciidoctornamespace in TypeScript:import asciidoctor, { Document } from '@asciidoctor/core' const Asciidoctor = asciidoctor() Asciidoctor.convert('Hello _world_')
-
Publish
@asciidoctor/coreas an ES6 module
-
- Bug Fixes
-
-
Strip alternate BOM that uses char code 65279 when input passes through a Buffer (#1344)
-
Map
Document.append(#1681) -
Bridge converter pass as option (#1666)
-
Add
getSectionNumeral()function by @benjaminleonard (#1659) -
Fix
getDocinfoandfindBytype definition (#1621) -
Bridge common Ruby object methods (#1491)
-
parseContentnow callstoHashon attrs (#1519)
-
- Improvements
-
-
Map
this.super.<method>to call the parent function (#1682) -
Map
AbstractBlock.getContentModelandAbstractBlock.setContentModel(#1680) -
Map
Document.getSyntaxHighlighter(#1667) -
Map
CompositeConverter#convert(#1649) -
Simplify table option checks by @mojavelinux (#1656)
-
Support Stream.Writable as
to_file(#1624)const data = [] const writableStream = new Writable({ write (chunk, encoding, callback) { data.push(chunk.toString()) callback() } }) const doc = asciidoctor.convert(text, { to_file: writableStream, safe: safe }) const html = data.join('')
-
- Infrastructure
-
-
Upgrade GraalVM to 20.1.0 (#1035)
-
- Documentation
-
-
Improve contributing guide by @cunka (#1676)
-
Remove call to
convert()on return value of process method for inline macro extension by @mojavelinux (#1653)
-
- Bug Fixes
-
-
Fix the Asciidoctor CLI provided by the
asciidoctorpackage (#846) - thanks @thorstenkampe -
AbstractNode.hasSectionnow returns false for anything that isn’t itself aSection(#840) - thanks @henriette-einstein -
Properly assign backend traits on converter instances (#904)
-
Bridge
Converter.handles?method (#906) -
Add or bridge the
Converter.respond_to?method (#908) -
Add or bridge the
Converter.composedmethod (#907) -
AbstractNode.getAttributesnow returnsundefinedwhen the value isOpal.nil(#920)
-
- Improvements
-
-
Upgrade
@asciidoctor/cliin theasciidoctorpackage to 3.4.0 (#902) -
Add a built-in template converter which support out-of-the-box the following template engines (optional dependency):
-
Pug
-
Nunjucks
-
EJS
-
Handlebars
-
-
Map
Document.restoreAttributes(#843) -
Map an internal API
Document.playbackAttributes(#844) -
Map
Table,Table.Rows,Table.ColumnandTable.Cell(#848) - thanks @henriette-einstein -
Map
Table.Cell.getInnerDocument(#901) -
Map
AbstractNode.resolveSubstitutions,AbstractBlock.resolveBlockSubstitutionsandAbstractNode.resolvePassSubstitutions(#845) -
Map
ConverterFactory.getRegistry(#909)class BlankConverter { convert () { return '' } } asciidoctor.ConverterFactory.register(new BlankConverter(), ['blank']) const registry = asciidoctor.ConverterFactory.getRegistry() registry.blank.convert()
-
Map
ConverterFactory.for(#910)const builtinHtml5Converter = asciidoctor.ConverterFactory.for('html5') builtinHtml5Converter.convert() asciidoctor.ConverterFactory.for('foo') // undefined
-
- Infrastructure
-
-
Publish binaries of the
asciidoctorCLI on GitHub releases (#929) -
Upgrade development dependencies
-
Bump
libnpmpublishfrom 1.1.1 to 3.0.0 (#863) -
Bump
cross-envfrom 5.1.4 to 6.0.3 in /packages/core (#879) -
Bump
dtslintfrom 2.0.3 to 3.4.0 in /packages/core (#888) (#871) -
Bump
@types/nodefrom 12.7.8 to 13.13.4 in /packages/core (#889) (#874) (#866) (#932) (#934) (#938) (#947) -
Bump
documentationfrom 12.1.3 to 12.3.0 in /packages/core (#882) (#897) (#903) -
Bump
sinonfrom 5.0.6 to 8.1.1 (#872) -
Bump
puppeteerfrom 1.18.0 to 2.1.1 in /packages/core (#876) -
Bump
eslintfrom 5.12.1 to 6.8.0 in /packages/core (#877) -
Bump
standardfrom 12.0.1 to 14.3.3 (#862) -
Bump
standardfrom 12.0.1 to 14.3.3 in /packages/core (#870) -
Bump
mochafrom 6.1.4 to 7.1.2 in /packages/core (#864) (#946) -
Bump
mochafrom 5.1.1 to 7.1.2 (#867) (#945) -
Bump
chaifrom 4.1.2 to 4.2.0 in /packages/core (#868) -
Bump
chaifrom 4.1.2 to 4.2.0 (#869) -
Bump
acornfrom 5.7.3 to 5.7.4 in /packages/core (#860) -
Bump
acornfrom 6.1.1 to 6.4.1 (#859) -
Bump
ejsfrom 3.0.1 to 3.0.2 in /packages/core (#922) -
Bump
pkgfrom 4.4.7 to 4.4.8 in /packages/asciidoctor (#948)
-
-
Add an explicit failure if the regular expression does not match in tests (#890)
-
Replace a Ruby example with a JavaScript example in the JSDoc (#856)
-
Increase tests timeout (#857)
-
Fix the
test:graalvmtask on macOS (#840) -
Keep
.dtsdirectory to workaround an issue with npm/Travis (#842) -
Test types against the built file (not the dist file) (#841)
-
Build on GitHub Actions (Windows) (#835)
-
Build the project on upstream changes (#839)
-
Fix newlines compatibility issues in tests (#838)
-
Add GitHub Actions badge (#836)
-
Run GitHub Actions on pull requests (#837)
-
Add the color extension in the documentation
-
Add the bytefield-svg extension in the documentation (#898)
-
- Bug Fixes
-
-
Fix type definition for
AbstractBlock.getCaption(#831) - thanks @cexbrayat -
Return
undefinedif the style isOpal.nilonAbstractBlock.getCaption(#831) - thanks @cexbrayat -
Add the missing
SyntaxHighlightertype definition (#832)
-
- Improvements
-
-
Deprecate
SyntaxHighlighter.for, useSyntaxHighlighter.getinstead (#832) -
Upgrade
@asciidoctor/cliin theasciidoctorpackage to 3.2.0
-
- Infrastructure
-
-
Include the TypeScript Definition File in the npm packages 😅 (#827)
-
- Bug Fixes
-
-
Return
undefinedif the style isOpal.nilonAbstractBlock.getStyle -
Return
undefinedif the level isOpal.nilonAbstractBlock.getLevel -
Processor.resolveAttributescan take a JSON, a boolean, a string, an array of strings or a list of strings as argument (#780)const registry = asciidoctor.Extensions.create(function () { this.inlineMacro('deg', function () { this.resolveAttributes('1:units', 'precision=1') //this.resolveAttributes(['1:units', 'precision=1']) //this.resolveAttributes({ '1:units': undefined, 'precision': 1 }) this.process(function (parent, target, attributes) { // ... }) }) })
-
Return
undefinedif the reftext isOpal.nilon anAbstractNode.getReftext -
Attach
applySubstitutionstoAbstractNodeinstead ofAbstractBlock(#793) -
Deprecate
counterIncrement, useDocument.incrementAndStoreCounterinstead (#792) -
Add
chrome://as a root path in a browser environment (#816)
-
- Improvements
-
-
Processor.resolvesAttributesis deprecated (in favor ofresolveAttributes) -
Add a TypeScript Declaration file (#752, #775, #826, #825)
-
Map
AbstractBlock.setStyle(#737) -
Map
AbstractBlock.setTitle(#737) -
Map
AbstractBlock.getSourceLocation(#737) -
Map
Section.setLevel(#737) -
Map
SyntaxProcessorDsl.defaultAttributes(#785)registry.inlineMacro('attrs', function () { const self = this self.matchFormat('short') self.defaultAttributes({ 1: 'a', 2: 'b', 'foo': 'baz' }) self.positionalAttributes('a', 'b') self.process((parent, target, attrs) => { // ... }) })
-
Initialize backend traits when registering a converter as an ES6 class or instance (#769)
// register a converter as an ES6 class class TEIConverter { constructor (backend, _) { this.backend = backend this.backendTraits = { basebackend: 'xml', outfilesuffix: '.xml', filetype: 'xml', htmlsyntax: 'xml' } } } asciidoctor.ConverterFactory.register(TEIConverter, ['tei'])
// register a converter as an ES6 class instance class TEIConverter { constructor () { this.backend = 'tei' this.basebackend = 'xml' this.outfilesuffix = '.xml' this.filetype = 'xml' this.htmlsyntax = 'xml' } } asciidoctor.ConverterFactory.register(new TEIConverter(), ['tei'])
-
Bridge ES6 class methods when registering a converter (#766)
class DelegateConverter { convert (node, transform) { // delegate to the class methods return this[`convert_${transform || node.node_name}`](node) } convert_embedded (node) { return `<delegate>${node.getContent()}</delegate>` } convert_paragraph (node) { return node.getContent() } } asciidoctor.ConverterFactory.register(new DelegateConverter(), ['delegate'])
-
Map
Asciidoctor.SafeMode(#777)console.log(asciidoctor.SafeMode.UNSAFE) // 0 console.log(asciidoctor.SafeMode.SAFE) // 1 console.log(asciidoctor.SafeMode.SERVER) // 10 console.log(asciidoctor.SafeMode.SECURE) // 20 console.log(asciidoctor.SafeMode.getValueForName('secure')) // 20 console.log(asciidoctor.SafeMode.getNameForValue(0)) // 'unsafe' console.log(asciidoctor.SafeMode.getNames()) // ['unsafe', 'safe', 'server', 'secure']
-
Map
Processor.createParagraph(#774) -
Map
Processor.createOpenBlock(#774) -
Map
Processor.createExampleBlock(#774) -
Map
Processor.createPassBlock(#774) -
Map
Processor.createListingBlock(#774) -
Map
Processor.createLiteralBlock(#774) -
Map
Processor.createAnchor(#774) -
Map
Processor.createInlinePass(#774) -
Map
AbstractNode.setId(#791) -
Add
Block.createto instantiate a newBlockobject (#796) -
Add
Section#createto instantiate a newSectionobject (#795) -
Map
Document.incrementAndStoreCounter(#792) -
Map
Reader.advance(#804) -
Map
Document.setSourcemap(#810)doc.setSourcemap(true)
-
Map
Processor.getConfig(#812) -
Map
Processor.option(#813)registry.inlineMacro('package', function () { this.option('defaultPackageUrlFormat', 'https://packages.ubuntu.com/bionic/%s') this.process(function (parent, target) { const format = parent.getDocument().getAttribute('url-package-url-format', this.getConfig().defaultPackageUrlFormat) return this.createInline(parent, 'anchor', target, { type: 'link', target: format.replace('%s', target), attributes: { window: '_blank' } }) }) })
-
Map
Asciidoctor.Callouts(#814) -
Map
Processor.parseAttributes(#815) -
Upgrade
@asciidoctor/cliin theasciidoctorpackage to 3.1.1 (#820) -
Add ES module interoperability when using TypeScript (#821)
-
Map
InlineProcessor.match(#823)
-
- Infrastructure
-
-
Run
npm audit fix -
Add tests on the docinfo feature (#734)
-
Add tests on a macro that creates a link (#745)
-
Upgrade development dependency
documentationto 12.1.3 (#762) -
Upgrade development dependency
mochato 6.1.4 (#739) -
Upgrade development dependency
puppeteerto 1.18.0 (#740) -
Upgrade development dependency
sinonto 7.3.2 (#741) -
Upgrade development dependency
eslint-utilsfrom 1.3.1 to 1.4.2 (#749) -
Add a sponsor button to GitHub that links to Open collective
-
Use a semantic versioning comparison in tests (#754)
-
Add tests on multiple single-item menu macros in single line (#754)
-
Upgrade GraalVM to 19.3.0 (#772)
-
Enable tests on
findByAPI (with reject) (#806) -
Build against the latest release of Asciidoctor 2.0.10 (#808)
-
Add tests on the TypeScript definition file (#800)
-
- Documentation
For information about older releases, refer to the releases page on GitHub.