Skip to content

Commit 05471b9

Browse files
committed
fixup comments, add verbatim tags
1 parent 6ca7314 commit 05471b9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/languages/yaml.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,16 @@ export default function(hljs) {
8686
className: 'type',
8787
begin: '!\\w+!' + URI_CHARACTERS,
8888
},
89-
{ // local tags
89+
// https://yaml.org/spec/1.2/spec.html#id2784064
90+
{ // verbatim tags
91+
className: 'type',
92+
begin: '!<' + URI_CHARACTERS + ">",
93+
},
94+
{ // primary tags
9095
className: 'type',
9196
begin: '!' + URI_CHARACTERS,
9297
},
93-
{ // data type
98+
{ // secondary tags
9499
className: 'type',
95100
begin: '!!' + URI_CHARACTERS,
96101
},

test/markup/yaml/tag.expect.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
<span class="hljs-attr">key:</span> <span class="hljs-type">!foo2.bar</span> <span class="hljs-string">test</span>
88
<span class="hljs-attr">key:</span> <span class="hljs-type">!(foo.bar?):tag</span> <span class="hljs-string">test</span>
99
<span class="hljs-attr">key:</span> <span class="hljs-type">!named!tag</span> <span class="hljs-string">test</span>
10+
11+
<span class="hljs-string">---</span> <span class="hljs-type">!&lt;tag:clarkevans.com,2002:invoice&gt;</span>
12+
<span class="hljs-attr">invoice:</span> <span class="hljs-number">34843</span>

test/markup/yaml/tag.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ key: !!python/name:module.name test
77
key: !foo2.bar test
88
key: !(foo.bar?):tag test
99
key: !named!tag test
10+
11+
--- !<tag:clarkevans.com,2002:invoice>
12+
invoice: 34843

0 commit comments

Comments
 (0)