Skip to content

Commit eb86e68

Browse files
committed
Support AsciiDoc.py double curly quote
LaTeX-style ``...''
1 parent 93180cd commit eb86e68

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

AsciiDoc.sublime-syntax

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ contexts:
643643
text-formatting-unconstrained:
644644
- include: text-bold-unconstrained
645645
- include: text-italic-unconstrained
646-
- include: text-monospace-unconstrained
646+
- include: text-monospace-unconstrained-or-double-curly-quote
647647
- include: text-highlight-unconstrained
648648
- include: text-subscript
649649
- include: text-superscript
@@ -680,26 +680,48 @@ contexts:
680680
- include: pop-end-of-definition
681681
- include: inlines
682682

683-
text-monospace-unconstrained:
683+
text-monospace-unconstrained-or-double-curly-quote:
684684
- match: \\`(?=`)
685685
scope: constant.character.escape.asciidoc
686686
- match: (``)[*_#~^](``)
687687
scope: markup.raw.inline.asciidoc
688688
captures:
689689
1: punctuation.definition.raw.begin.asciidoc
690690
2: punctuation.definition.raw.end.asciidoc
691+
- match: (?=``\S)
692+
branch_point: monospace-or-double-curly
693+
branch:
694+
- latex-double-curly-quote
695+
- text-monospace-unconstrained
696+
697+
text-monospace-unconstrained:
691698
- match: '``'
692699
scope: punctuation.definition.raw.begin.asciidoc
693700
embed: text-monospace-unconstrained-body
694701
escape: (``)|{{bol}}(\n)
695702
escape_captures:
696703
1: markup.raw.inline.asciidoc punctuation.definition.raw.end.asciidoc
697704
2: invalid.illegal.new-block.asciidoc
705+
- include: else-pop
698706

699707
text-monospace-unconstrained-body:
700708
- meta_scope: markup.raw.inline.asciidoc
701709
- include: inlines
702710

711+
latex-double-curly-quote:
712+
- match: '``(?=\S)'
713+
scope: constant.character.asciidoc
714+
push: latex-double-curly-quote-body
715+
- include: else-pop
716+
717+
latex-double-curly-quote-body:
718+
- match: \'\'{{constrained_break}}
719+
scope: constant.character.asciidoc
720+
pop: 1
721+
- match: \S?[`*_#~^]{{constrained_break}}
722+
fail: monospace-or-double-curly
723+
- include: inlines
724+
703725
text-highlight-unconstrained:
704726
- match: \\#(?=#)
705727
scope: constant.character.escape.asciidoc

tests/syntax_test_git_docs.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ pathname::
152152
Add modified contents in the working tree interactively to
153153
the index. Optional path arguments may be supplied to limit
154154
operation to a subset of the working tree. See ``Interactive
155+
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.asciidoc
156+
// ^^ constant.character.asciidoc
155157
mode'' for details.
158+
//^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.asciidoc
159+
// ^^ constant.character.asciidoc
156160

157161

158162

0 commit comments

Comments
 (0)