diff --git a/grammars/language-asciidoc.cson b/grammars/language-asciidoc.cson index 45dfe04..f1a65ef 100644 --- a/grammars/language-asciidoc.cson +++ b/grammars/language-asciidoc.cson @@ -2679,33 +2679,6 @@ repository: } ] } - { - begin: "^\\[([^\\]]+)\\]$" - beginCaptures: - "0": - name: "support.asciidoc" - "1": - name: "markup.meta.attribute-list.asciidocc" - end: "(?<=----)[\\r\\n]+$" - patterns: [ - { - name: "markup.raw.asciidoc" - begin: "^(-{4,})\\s*$" - beginCaptures: - "0": - name: "support.asciidoc" - patterns: [ - { - include: "#block-callout" - } - ] - end: "^\\1*$" - endCaptures: - "0": - name: "support.asciidoc" - } - ] - } { name: "markup.raw.asciidoc" begin: "^(-{4,})\\s*$" diff --git a/lib/code-block-generator.coffee b/lib/code-block-generator.coffee index 1b913bd..f0cedcc 100644 --- a/lib/code-block-generator.coffee +++ b/lib/code-block-generator.coffee @@ -52,26 +52,6 @@ module.exports = 0: name: 'support.asciidoc' ] - # add generic block with attributes only - codeBlocks.push - begin: '^\\[([^\\]]+)\\]$' - beginCaptures: - 0: name: 'support.asciidoc' - 1: name: 'markup.meta.attribute-list.asciidocc' - end: '(?<=----)[\\r\\n]+$' - patterns: [ - name: 'markup.raw.asciidoc' - begin: '^(-{4,})\\s*$' - beginCaptures: - 0: name: 'support.asciidoc' - patterns: [ - include: '#block-callout' - ] - end: '^\\1*$' - endCaptures: - 0: name: 'support.asciidoc' - ] - # add listing block codeBlocks.push name: 'markup.raw.asciidoc' diff --git a/spec/code-block-generator-spec.coffee b/spec/code-block-generator-spec.coffee index 40ab5c6..9529ac6 100644 --- a/spec/code-block-generator-spec.coffee +++ b/spec/code-block-generator-spec.coffee @@ -7,7 +7,7 @@ describe 'Code block generator', -> it 'should generate default code block', -> languages = [] codeBlocks = generator.makeAsciidocBlocks(languages) - expect(codeBlocks).toHaveLength 3 # Number of blocks + expect(codeBlocks).toHaveLength 2 # Number of blocks expect(codeBlocks[0]).toEqualJson begin: '^\\[(source)(,([^\\]]*))?\\]$' beginCaptures: @@ -28,34 +28,11 @@ describe 'Code block generator', -> 0: name: 'support.asciidoc' ] - it 'should generate default code block with attributes only', -> - languages = [] - codeBlocks = generator.makeAsciidocBlocks(languages) - expect(codeBlocks).toHaveLength 3 # Number of blocks - expect(codeBlocks[1]).toEqualJson - begin: '^\\[([^\\]]+)\\]$' - beginCaptures: - 0: name: 'support.asciidoc' - 1: name: 'markup.meta.attribute-list.asciidocc' - end: '(?<=----)[\\r\\n]+$' - patterns: [ - name: 'markup.raw.asciidoc' - begin: '^(-{4,})\\s*$' - beginCaptures: - 0: name: 'support.asciidoc' - patterns: [ - include: '#block-callout' - ] - end: '^\\1*$' - endCaptures: - 0: name: 'support.asciidoc' - ] - it 'should generate listing block', -> languages = [] codeBlocks = generator.makeAsciidocBlocks(languages) - expect(codeBlocks).toHaveLength 3 # Number of blocks - expect(codeBlocks[2]).toEqualJson + expect(codeBlocks).toHaveLength 2 # Number of blocks + expect(codeBlocks[1]).toEqualJson name: 'markup.raw.asciidoc' begin: '^(-{4,})\\s*$' beginCaptures: @@ -72,7 +49,7 @@ describe 'Code block generator', -> pattern: 'javascript|js', type: 'source', code: 'js' ] codeBlocks = generator.makeAsciidocBlocks(languages) - expect(codeBlocks).toHaveLength 4 # Number of blocks + expect(codeBlocks).toHaveLength 3 # Number of blocks expect(codeBlocks[0]).toEqualJson begin: '^\\[(source),\\p{Blank}*(?i:(javascript|js))(?:,([^\]]*))?\\]$' beginCaptures: @@ -106,7 +83,7 @@ describe 'Code block generator', -> pattern: 'c(pp|\\+\\+)', type: 'source', code: 'cpp' ] codeBlocks = generator.makeAsciidocBlocks(languages) - expect(codeBlocks).toHaveLength 4 # Number of blocks + expect(codeBlocks).toHaveLength 3 # Number of blocks expect(codeBlocks[0]).toEqualJson begin: '^\\[(source),\\p{Blank}*(?i:(c(pp|\\+\\+)))(?:,([^\]]*))?\\]$' beginCaptures: