diff --git a/src/Templates/highlight.php/yaml.json b/src/Templates/highlight.php/yaml.json index a8b796b..3db70a8 100644 --- a/src/Templates/highlight.php/yaml.json +++ b/src/Templates/highlight.php/yaml.json @@ -79,6 +79,10 @@ "literal": "true false yes no null" } }, + { + "className": "number", + "begin": "\\b([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(([Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(\\.([0-9]*))?([ \\t]*(Z|([-+])([0-9][0-9]?)(:([0-9][0-9]))?))?)?\\b" + }, { "className": "number", "begin": "(-?)(\\b0[xX][a-fA-F0-9_]+|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eE][-+]?\\d[\\d_]*)?)\\b" diff --git a/tests/fixtures/expected/blocks/code-blocks/yaml.html b/tests/fixtures/expected/blocks/code-blocks/yaml.html index 9af8127..2de3b7b 100644 --- a/tests/fixtures/expected/blocks/code-blocks/yaml.html +++ b/tests/fixtures/expected/blocks/code-blocks/yaml.html @@ -1,11 +1,15 @@ -
+
1
 2
 3
 4
 5
-6
+6 +7 +8 +9 +10
             
                 # some code
@@ -18,6 +22,14 @@
                 3.14159_26535_89793
                 hex_words:
                 0x_CAFE_F00D
+                canonical:
+                2001-12-15T02:59:43.1Z
+                iso8601:
+                2001-12-14t21:59:43.10-05:00
+                spaced:
+                2001-12-14 21:59:43.10 -5
+                date:
+                2002-12-14
             
         
diff --git a/tests/fixtures/source/blocks/code-blocks/yaml.rst b/tests/fixtures/source/blocks/code-blocks/yaml.rst index 0bba2a6..f56652d 100644 --- a/tests/fixtures/source/blocks/code-blocks/yaml.rst +++ b/tests/fixtures/source/blocks/code-blocks/yaml.rst @@ -6,3 +6,7 @@ long_number: 10_000_000_000 pi: 3.14159_26535_89793 hex_words: 0x_CAFE_F00D + canonical: 2001-12-15T02:59:43.1Z + iso8601: 2001-12-14t21:59:43.10-05:00 + spaced: 2001-12-14 21:59:43.10 -5 + date: 2002-12-14