1 | var jsdev = require('JSDev');
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | module.exports = function processor(content, attrs, scope) {
|
14 | if (!content) {
|
15 | return content;
|
16 | }
|
17 | var tags;
|
18 | if (attrs.tags) {
|
19 |
|
20 | tags = scope.execImport(attrs.tags);
|
21 | if (/^\[[^]*\]$/.test(tags)) {
|
22 | tags = new Function(
|
23 | 'return (' +
|
24 | tags +
|
25 | ');'
|
26 | )();
|
27 | } else {
|
28 | tags = tags.split(/\s*[,\n]\s*/);
|
29 | }
|
30 | } else {
|
31 | tags = [];
|
32 | }
|
33 |
|
34 | var comments;
|
35 | if (attrs.comments) {
|
36 | comments = scope.execImport(attrs.comments);
|
37 | } else {
|
38 | comments = null;
|
39 | }
|
40 | return jsdev(content, tags, comments);
|
41 | };
|