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-alpha.4 to 1.0.0-alpha.5

18

lib/xref/parse-page-id.js

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

*
* * If a component is specified, but not a version, the version defaults to master.
* * If a component is specified, but not a version, the version remains undefined.
* * If a component is specified, but not a module, the module defaults to ROOT.

@@ -35,19 +35,15 @@ *

let relative = match[PAGE_ID_RXG.page] + '.adoc'
const family = 'page'
if (component) {
// if a component is specified, but not a version, assume version is "master"
if (!version) version = 'master'
// if a component is specified, but not a module, assume module is "ROOT"
if (!module) module = 'ROOT'
} else {
component = ctx.component
if (!version) version = ctx.version
if (!module) module = ctx.module
}
return {
component: component || ctx.component,
version: version || ctx.version,
module: module || ctx.module,
family: 'page',
relative,
}
return { component, version, module, family, relative }
}
module.exports = parsePageId

@@ -9,5 +9,7 @@ 'use strict'

* Parses the specified contextual page ID spec into a page ID object using
* parsePageId, then attempts to locate a file with this page ID in the catalog.
* If a file cannot be resolved, the function returns undefined. If the spec
* does not match the page ID syntax, this function throws an error.
* parsePageId, then attempts to locate a file with this page ID in the
* catalog. If a component is specified, but not a version, the latest version
* of the component is used from the catalog. If a file cannot be resolved, the
* function returns undefined. If the spec does not match the page ID syntax,
* this function throws an error.
*

@@ -29,2 +31,7 @@ * @memberof asciidoc-loader

if (!id.version) {
const component = catalog.getComponent(id.component)
if (component) id.version = component.latestVersion.version
}
return catalog.getById(id)

@@ -31,0 +38,0 @@ }

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

@@ -5,0 +5,0 @@ "license": "MPL-2.0",

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