We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d647b9d commit 8437ba2Copy full SHA for 8437ba2
lib/parser.js
@@ -40,7 +40,8 @@ exports.parse = (markdown) => {
40
}
41
42
let example = page.examples[page.examples.length-1];
43
- if (example) {
+ // If example exists and a code is already not added
44
+ if (example && !example.code) {
45
example.code = unhtml(text);
46
47
return text;
test/parser.spec.js
@@ -119,6 +119,8 @@ describe('Parser', () => {
119
120
\`cmd2 --foo\``
121
);
122
+ page.examples[0].code.should.eql('cmd1 --foo');
123
+ page.examples[1].code.should.eql('cmd2 --foo');
124
page.examples[0].description.should.eql('example 1, see inline_cmd1 for details');
125
page.examples[1].description.should.eql('example 2, see inline_cmd2 for details');
126
});
0 commit comments