Set asciiDoctor base_dir
This commit is contained in:
parent
09acc1c9d5
commit
dd15655896
10
index.html
10
index.html
@ -41,7 +41,9 @@
|
||||
xhr.responseText +
|
||||
"\n----------------------\n";
|
||||
if (requestData.url.endsWith(".adoc")) {
|
||||
let html = asciiDoctor.convert(xhr.responseText, { attributes: { 'allow-uri-read': true } });
|
||||
const baseDir = requestData.url.replace(/\/[^/]*$/, "/");
|
||||
const opts = {safe: 'safe', base_dir: baseDir, attributes: { } };
|
||||
let html = asciiDoctor.convert(xhr.responseText, opts);
|
||||
requestState += html + "\n----------------------\n";
|
||||
}
|
||||
}
|
||||
@ -60,12 +62,6 @@
|
||||
divResult.innerText = divResult.innerText + "Exception while calling " + requestData.url + "\n" + exceptionMessage + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
const doc = asciiDoctor.loadFile("rspec/rules/S3457/java/rule.adoc");
|
||||
divResult.innerText = divResult.innerText +
|
||||
"\n----------------------\n" +
|
||||
doc.convert(doc, {doctype: 'inline'}) +
|
||||
"\n----------------------\n";
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user