Skip to content

Commit

Permalink
resolves #639 set env attribute to vscode (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie authored Oct 2, 2022
1 parent ec8b78b commit 583c1a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/asciidocParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class AsciidocParser {
const options: { [key: string]: any } = {
attributes: {
'env-vscode': '',
env: 'vscode',
...asciidoctorAttributes,
},
backend,
Expand Down Expand Up @@ -91,6 +92,7 @@ export class AsciidocParser {
const document = processor.load(textDocument.getText(), {
attributes: {
'env-vscode': '',
env: 'vscode',
},
extension_registry: registry,
sourcemap: true,
Expand Down Expand Up @@ -144,7 +146,7 @@ export class AsciidocParser {
highlightjsBuiltInSyntaxHighlighter.$register_for('highlight.js', 'highlightjs')
}

const attributes = {}
const attributes: { [key: string]: any } = {}
Object.keys(previewAttributes).forEach((key) => {
const attributeValue = previewAttributes[key]
if (typeof attributeValue === 'string') {
Expand All @@ -155,6 +157,7 @@ export class AsciidocParser {
}
})
attributes['env-vscode'] = ''
attributes.env = 'vscode'

const baseDir = AsciidocParser.getBaseDir(doc.fileName)
const templateDirs = this.getTemplateDirs()
Expand Down

0 comments on commit 583c1a9

Please sign in to comment.