diff --git a/CHANGELOG.md b/CHANGELOG.md index be441c3a..de08ebc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ For detailed information check [Blogophon's releases on Github](https://github.c * :gift: Add favicons to feeds * :gift: Add new properties to `manifest.json` * :gift: Add [abc music notation](http://abcnotation.com/wiki/abc:standard:v2.1) syntax highlighter -* :gift: Add [Exapunk AXIOM](http://www.zachtronics.com/exapunks/) syntax highlighter +* :gift: Add [Exapunks' AXIOM](http://www.zachtronics.com/exapunks/) syntax highlighter 1.5.0 ----- diff --git a/docs/markdown.md b/docs/markdown.md index abf129c6..0fd55036 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -271,7 +271,7 @@ The following identifiers are supported: * `abc` to output [abc music notation](http://abcnotation.com/wiki/abc:standard:v2.1) examples * `apacheconf` -* `axiom` for [Exapunk AXIOM](http://www.zachtronics.com/exapunks/) +* `axiom` for [Exapunks' AXIOM](http://www.zachtronics.com/exapunks/) * `css` * `html` * `ini` diff --git a/lib/helpers/marky-mark.js b/lib/helpers/marky-mark.js index 2deb5531..90d8402d 100644 --- a/lib/helpers/marky-mark.js +++ b/lib/helpers/marky-mark.js @@ -451,36 +451,43 @@ const markyMark = function(string, rules) { }; /** - * Convert Axiom text node + * Convert Exapunks' Axiom text node * @see http://www.zachtronics.com/exapunks/ * @param {String} string [description] * @return {String} [description] */ internal.convertAxiom = (string) => { - return string - .split(/\n/) + return string.split(/\n/) .map((line) => { - return line.replace(/(^\s*)([A-Z]+)(\s(.+))?\s*$/, (all, start, cmd, args, argsInner) => { + return line.replace(/(^\s*)(@?[A-Z]+)(\s(.+))?\s*$/, (all, start, cmd, args, argsInner) => { args = args || ''; argsInner = argsInner || ''; switch (cmd) { case 'NOTE': return start + '' + cmd + args + ''; + case '@REP': + case '@END': + return start + '' + cmd + args + ''; case 'MARK': case 'JUMP': case 'TJMP': case 'FJMP': - return start + '' + cmd + ' ' + argsInner + ''; + argsInner = argsInner.replace(/(@\{.+\})/, '$1'); + argsInner = '' + argsInner + ''; + argsInner = argsInner.replace(/<\/b>/g, ''); + return start + '' + cmd + ' ' + argsInner; default: argsInner = argsInner.split(/ /).map((a) => { if (cmd === 'TEST' && a.match(/^(EOF|MRD)$/)) { - return '' + a + ''; // Special test cases + return '' + a + ''; // Special test cases } else if (a.match(/^-?\d+$/)) { - return '' + a + ''; // Integers + return '' + a + ''; // Integers } else if (a.match(/^#/)) { - return '' + a + ''; // Intefaces + return '' + a + ''; // Interfaces + } else if (a.match(/^@/)) { + return '' + a + ''; // Repetitions } else if (a.match(/[XFTM]/)) { - return '' + a + ''; // Registers + return '' + a + ''; // Registers } return a; }).join(' '); diff --git a/package.json b/package.json index 48373d67..8655e58a 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "inquirer": "^6.0.0", "inquirer-datepicker-prompt": "^0.4.2", "js-yaml": "^3.11.0", - "marked": "^0.4.0", + "marked": "^0.5.0", "remove-markdown": "^0.3.0", "shelljs": "^0.8.2" }, diff --git a/test/marky-mark.js b/test/marky-mark.js index c1810914..a14c92e3 100644 --- a/test/marky-mark.js +++ b/test/marky-mark.js @@ -522,7 +522,7 @@ DEF [r:and this is a remark with a | or so] FED:|] }, // ----------------------------------------------------------------------- { - language: 'Axiom for Exapunk', + language: 'Axiom for Exapunks', snippet: `
GRAB 200
 SEEK 9999
 SEEK -2
@@ -556,9 +556,14 @@ LINK -1
 DROP
 
 NOTE DONE
+
+@REP 3
+  TEST X = @{0,5}
+  TJMP CASE@{0,1}
+@END
 
`, hasComments: true, - expected: 124 + expected: 124 + 16 } ];