Skip to content

Commit

Permalink
fixup comments, add verbatim tags
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Apr 21, 2020
1 parent 6ca7314 commit 05471b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/languages/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@ export default function(hljs) {
className: 'type',
begin: '!\\w+!' + URI_CHARACTERS,
},
{ // local tags
// https://yaml.org/spec/1.2/spec.html#id2784064
{ // verbatim tags
className: 'type',
begin: '!<' + URI_CHARACTERS + ">",
},
{ // primary tags
className: 'type',
begin: '!' + URI_CHARACTERS,
},
{ // data type
{ // secondary tags
className: 'type',
begin: '!!' + URI_CHARACTERS,
},
Expand Down
3 changes: 3 additions & 0 deletions test/markup/yaml/tag.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
<span class="hljs-attr">key:</span> <span class="hljs-type">!foo2.bar</span> <span class="hljs-string">test</span>
<span class="hljs-attr">key:</span> <span class="hljs-type">!(foo.bar?):tag</span> <span class="hljs-string">test</span>
<span class="hljs-attr">key:</span> <span class="hljs-type">!named!tag</span> <span class="hljs-string">test</span>

<span class="hljs-string">---</span> <span class="hljs-type">!&lt;tag:clarkevans.com,2002:invoice&gt;</span>
<span class="hljs-attr">invoice:</span> <span class="hljs-number">34843</span>
3 changes: 3 additions & 0 deletions test/markup/yaml/tag.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ key: !!python/name:module.name test
key: !foo2.bar test
key: !(foo.bar?):tag test
key: !named!tag test

--- !<tag:clarkevans.com,2002:invoice>
invoice: 34843

0 comments on commit 05471b9

Please sign in to comment.