@antora/asciidoc-loader
Advanced tools
Comparing version 3.0.0-alpha.3 to 3.0.0-alpha.4
@@ -23,7 +23,13 @@ 'use strict' | ||
let callback | ||
let refSpec = node.getAttribute('path', undefined, false) | ||
let refSpec = | ||
node.getAttribute('path', undefined, false) || | ||
// NOTE detect and convert self reference into a page reference | ||
(node.target === '#' && | ||
node.getText() == null && | ||
node.getAttribute('refid', undefined, false) == null && | ||
node.getDocument().getAttribute('page-relative-src-path')) | ||
if (refSpec && (callback = this[$pageRefCallback])) { | ||
const attrs = node.getAttributes() | ||
const fragment = attrs.fragment | ||
if (fragment && fragment !== Opal.nil) refSpec += '#' + fragment | ||
if (fragment) refSpec += '#' + fragment | ||
const { content, target, internal, unresolved } = callback(refSpec, node.getText()) | ||
@@ -33,5 +39,4 @@ let type | ||
type = 'xref' | ||
delete attrs.path | ||
delete attrs.fragment | ||
attrs.refid = fragment // or target.substr(1) | ||
attrs.path = undefined | ||
attrs.fragment = attrs.refid = fragment | ||
} else { | ||
@@ -38,0 +43,0 @@ type = 'link' |
'use strict' | ||
// IMPORTANT eagerly load Opal to force the String encoding from UTF-16LE to UTF-8 | ||
const Opal = require('asciidoctor-opal-runtime').Opal | ||
if ('encoding' in String.prototype && String(String.prototype.encoding) !== 'UTF-8') { | ||
String.prototype.encoding = Opal.const_get_local(Opal.const_get_qualified('::', 'Encoding'), 'UTF_8') // eslint-disable-line no-extend-native | ||
} | ||
const asciidoctor = require('@asciidoctor/core')() | ||
const Opal = global.Opal | ||
const Extensions = asciidoctor.Extensions | ||
@@ -121,3 +116,3 @@ const convertImageRef = require('./image/convert-image-ref') | ||
if (origin.worktree) { | ||
attrs['page-origin-worktree'] = '' | ||
attrs['page-origin-worktree'] = origin.worktree | ||
attrs['page-origin-refhash'] = '(worktree)' | ||
@@ -124,0 +119,0 @@ } else { |
{ | ||
"name": "@antora/asciidoc-loader", | ||
"version": "3.0.0-alpha.3", | ||
"version": "3.0.0-alpha.4", | ||
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.", | ||
@@ -20,4 +20,3 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@asciidoctor/core": "~2.2.0", | ||
"asciidoctor-opal-runtime": "0.3.2" | ||
"@asciidoctor/core": "~2.2" | ||
}, | ||
@@ -39,3 +38,3 @@ "engines": { | ||
], | ||
"gitHead": "2f02cf0d42fb5db4607ea5e600ca8a4ab45d5a5f" | ||
"gitHead": "aaa76a6387e339052d0bfb298add24f56f42a828" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
750
50103
- Removedasciidoctor-opal-runtime@0.3.2
- Removedasciidoctor-opal-runtime@0.3.2(transitive)
Updated@asciidoctor/core@~2.2