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,10 +41,12 @@ 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)) {
|
||||
if (type == 'comment') {
|
||||
// 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(
|
||||
trim(token.value.slice(2, -2))
|
||||
|
|
Loading…
Reference in a new issue