Skip to content

Commit

Permalink
Merge branch 'master' into feature/2018-08-07-file-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Aug 17, 2018
2 parents bd9774a + 1f9d474 commit 496241e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
25 changes: 16 additions & 9 deletions lib/helpers/marky-mark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '<u>' + cmd + args + '</u>';
case '@REP':
case '@END':
return start + '<samp>' + cmd + args + '</samp>';
case 'MARK':
case 'JUMP':
case 'TJMP':
case 'FJMP':
return start + '<i>' + cmd + '</i> <b>' + argsInner + '</b>';
argsInner = argsInner.replace(/(@\{.+\})/, '</b><samp>$1</samp><b>');
argsInner = '<b>' + argsInner + '</b>';
argsInner = argsInner.replace(/<b><\/b>/g, '');
return start + '<i>' + cmd + '</i> ' + argsInner;
default:
argsInner = argsInner.split(/ /).map((a) => {
if (cmd === 'TEST' && a.match(/^(EOF|MRD)$/)) {
return '<i>' + a + '</i>'; // Special test cases
return '<i>' + a + '</i>'; // Special test cases
} else if (a.match(/^-?\d+$/)) {
return '<em>' + a + '</em>'; // Integers
return '<em>' + a + '</em>'; // Integers
} else if (a.match(/^#/)) {
return '<var>' + a + '</var>'; // Intefaces
return '<var>' + a + '</var>'; // Interfaces
} else if (a.match(/^@/)) {
return '<samp>' + a + '</samp>'; // Repetitions
} else if (a.match(/[XFTM]/)) {
return '<kbd>' + a + '</kbd>'; // Registers
return '<kbd>' + a + '</kbd>'; // Registers
}
return a;
}).join(' ');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 7 additions & 2 deletions test/marky-mark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<pre><code class="lang-axiom">GRAB 200
SEEK 9999
SEEK -2
Expand Down Expand Up @@ -556,9 +556,14 @@ LINK -1
DROP
NOTE DONE
@REP 3
TEST X = @{0,5}
TJMP CASE@{0,1}
@END
</code></pre>`,
hasComments: true,
expected: 124
expected: 124 + 16
}
];

Expand Down

0 comments on commit 496241e

Please sign in to comment.