Socket
Socket
Sign inDemoInstall

@antora/asciidoc-loader

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/asciidoc-loader - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

47

lib/include/include-processor.js

@@ -23,7 +23,10 @@ 'use strict'

if (resolvedFile) {
let contents = resolvedFile.contents
let includeContents = resolvedFile.contents
let startLineNum = 1
const tags = getTags(attrs)
if (tags) [contents, startLineNum] = applyTagFiltering(contents, tags)
reader.pushInclude(contents, resolvedFile.file, resolvedFile.path, startLineNum, attrs)
if (tags) [includeContents, startLineNum] = applyTagFiltering(includeContents, tags)
const includes = doc.getCatalog().includes.$dup()
reader.pushInclude(includeContents, resolvedFile.file, resolvedFile.path, startLineNum, attrs)
// TODO after upgrading to 1.5.7, pass partial-option attribute instead
doc.getCatalog().includes.$replace(includes)
}

@@ -39,3 +42,3 @@ })

if (tag && tag !== '!') {
return tag.charAt() === '!' ? { [tag.substr(1)]: false } : { [tag]: true }
return tag.charAt() === '!' ? new Map().set(tag.substr(1), false) : new Map().set(tag, true)
}

@@ -45,3 +48,3 @@ } else if (attrs['$key?']('tags')) {

if (tags) {
let result = {}
let result = new Map()
let any = false

@@ -51,7 +54,3 @@ tags.split(TAG_DELIMITER_RX).forEach((tag) => {

any = true
if (tag.charAt() === '!') {
result[tag.substr(1)] = false
} else {
result[tag] = true
}
tag.charAt() === '!' ? result.set(tag.substr(1), false) : result.set(tag, true)
}

@@ -66,16 +65,16 @@ })

let selecting, selectingDefault, wildcard
if ('**' in tags) {
if ('*' in tags) {
selectingDefault = selecting = tags['**']
wildcard = tags['*']
delete tags['*']
if (tags.has('**')) {
if (tags.has('*')) {
selectingDefault = selecting = tags.get('**')
wildcard = tags.get('*')
tags.delete('*')
} else {
selectingDefault = selecting = wildcard = tags['**']
selectingDefault = selecting = wildcard = tags.get('**')
}
delete tags['**']
tags.delete('**')
} else {
selectingDefault = selecting = !Object.values(tags).includes(true)
if ('*' in tags) {
wildcard = tags['*']
delete tags['*']
selectingDefault = selecting = !Array.from(tags.values()).includes(true)
if (tags.has('*')) {
wildcard = tags.get('*')
tags.delete('*')
}

@@ -106,3 +105,3 @@ }

;[activeTag, selecting] = tagStack.length ? tagStack[0] : [undefined, selectingDefault]
} else if (thisTag in tags) {
} else if (tags.has(thisTag)) {
const idx = tagStack.findIndex(([name]) => name === thisTag)

@@ -117,5 +116,5 @@ if (~idx) {

}
} else if (thisTag in tags) {
} else if (tags.has(thisTag)) {
usedTags.push(thisTag)
tagStack.unshift([(activeTag = thisTag), (selecting = tags[thisTag])])
tagStack.unshift([(activeTag = thisTag), (selecting = tags.get(thisTag))])
} else if (wildcard !== undefined) {

@@ -122,0 +121,0 @@ selecting = activeTag && !selecting ? false : wildcard

@@ -165,4 +165,3 @@ 'use strict'

function isExtensionRegistered (ext, registry) {
// FIXME drop check for groups property after upgrading to Asciidoctor.js 1.5.6
return registry.groups && Object.values(registry.getGroups()).includes(ext)
return Object.values(registry.getGroups()).includes(ext)
}

@@ -169,0 +168,0 @@

@@ -15,2 +15,3 @@ 'use strict'

// NOTE refSpec is undefined if inter-document xref refers to current docname and fragment is empty
// TODO remove check for file extension after upgrading to 1.5.7
(refSpec && refSpec.endsWith('.adoc') && (refSpec = refSpec.substr(0, refSpec.length - 5)) !== undefined)

@@ -21,6 +22,11 @@ ) {

const { content, target } = callback(refSpec, node.getText())
// TODO pass attributes (e.g., id, role) once core parses them
const attributes = target.charAt() === '#' ? undefined : Opal.hash({ role: 'page' })
// FIXME switch to node.getParent() after upgrading to Asciidoctor.js 1.5.6
node = Inline.$new(node.parent, 'anchor', content, Opal.hash({ type: 'link', target, attributes }))
let options
if (target.charAt() === '#') {
options = Opal.hash2(['type', 'target'], { type: 'link', target })
} else {
// TODO pass attributes (e.g., id, role) after upgrading to 1.5.7
const attributes = Opal.hash2(['role'], { role: 'page' })
options = Opal.hash2(['type', 'target', 'attributes'], { type: 'link', target, attributes })
}
node = Inline.$new(node.getParent(), 'anchor', content, options)
}

@@ -27,0 +33,0 @@ }

{
"name": "@antora/asciidoc-loader",
"version": "1.0.0",
"version": "1.0.1",
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.",

@@ -19,3 +19,3 @@ "license": "MPL-2.0",

"dependencies": {
"asciidoctor.js": "1.5.6-rc.1"
"asciidoctor.js": "1.5.6"
},

@@ -22,0 +22,0 @@ "engines": {

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