leave doc comments in the source code
This commit is contained in:
parent
6c44f683d6
commit
9c20602324
1 changed files with 6 additions and 4 deletions
|
@ -41,9 +41,11 @@ Ox.SourceViewer = function(options, self) {
|
|||
Ox.get(self.options.file, function(source) {
|
||||
var sections = [{comment: '', code: ''}];
|
||||
Ox.tokenize(source).forEach(function(token, i) {
|
||||
var type = token.type == 'comment' ? 'comment' : 'code';
|
||||
// ignore '//' comments
|
||||
if (!/^\/\//.test(token.value)) {
|
||||
// treat doc comments as code
|
||||
var type = token.type == 'comment' && token.value[2] != '@'
|
||||
? 'comment' : 'code';
|
||||
// remove '//' comments
|
||||
if (!/^\/\/[^@]/.test(token.value)) {
|
||||
if (type == 'comment' ) {
|
||||
i && sections.push({comment: '', code: ''});
|
||||
token.value = Ox.parseMarkdown(
|
||||
|
|
Loading…
Reference in a new issue