Skip to content

Commit 25e7bfa

Browse files
committed
JSHinted and some comments
1 parent 9110267 commit 25e7bfa

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

angular-marked.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
* License: MIT
55
*/
66

7-
/*
8-
9-
TODO: tests:
10-
11-
<marked>##TEXT 1</marked>
12-
<div marked>##TEXT 2</div>
13-
<div ng-init="scope_element = '##TEST 4'"><div marked="scope_element"></div></div>
14-
<div marked="'##TEXT 3'"></div>
15-
<div marked opts="{gfm: true}"></div>
16-
<div marked ng-include="'filename.md'"></div>
17-
18-
*/
7+
/* jshint undef: true, unused: true */
8+
/* global angular:true */
9+
/* global marked:true */
1910

2011
(function () {
12+
'use strict';
2113

2214
var app = angular.module('hc.marked', []);
2315

2416
app.constant('marked', marked);
2517

26-
//TODO: filter
18+
// Maybe this is better?
19+
//app.service('marked', ['$window', function($window) {
20+
// return $window.marked;
21+
//}]);
22+
23+
// TODO: filter tests */
24+
//app.filter('marked', ['marked', function(marked) {
25+
// return marked;
26+
//}]);
2727

28-
app.directive("marked", ['$http', 'marked', function ($http, marked) {
28+
app.directive('marked', ['marked', function (marked) {
2929
return {
3030
restrict: 'AE',
3131
replace: true,
@@ -34,12 +34,12 @@
3434
marked: '='
3535
},
3636
link: function (scope, element, attrs) {
37-
var value = scope.marked || element.text()|| '';
37+
var value = scope.marked || element.text() || '';
3838
element.html(marked(value, scope.opts || null));
3939

4040
if (attrs.marked)
4141
scope.$watch('marked', function(value) {
42-
element.html(marked(scope.marked || '', scope.opts || null));
42+
element.html(marked(value || '', scope.opts || null));
4343
});
4444

4545
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-marked",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"authors": [
55
"Hypercubed <[email protected]>"
66
],

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = function(config) {
1515
files: [
1616
'bower_components/angular/angular.js',
1717
'bower_components/angular-mocks/angular-mocks.js',
18-
'bower_components/marked/lib/marked.js',
1918
'angular-marked.js',
19+
'bower_components/marked/lib/marked.js',
2020
'test/spec/**/*.js'
2121
],
2222

0 commit comments

Comments
 (0)