leave doc comments in the source code

This commit is contained in:
rolux 2012-05-30 15:20:00 +02:00
parent 6c44f683d6
commit 9c20602324

View file

@ -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))