Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6d9313a

Browse files
committed
fix(docs): fix broken ng-docs specs
1 parent 212f685 commit 6d9313a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/ngdoc.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Doc.prototype = {
5252
Doc.METADATA_IGNORE.forEach(function(ignore){ keywords[ignore] = true; });
5353

5454
function extractWords(text) {
55-
var tokens = text.toLowerCase().split(/[,\.\`\'\"\#\s]+/mg);
55+
var tokens = text.toLowerCase().split(/[\.\s,`'"#]+/mg);
5656
tokens.forEach(function(key){
57-
var match = key.match(/^(([\$\_a-z]|ng\:)[\w\_\-]+)/);
57+
var match = key.match(/^((ng:|[\$_a-z])[\w\-_]+)/);
5858
if (match){
5959
key = match[1];
6060
if (!keywords[key]) {
@@ -215,7 +215,7 @@ Doc.prototype = {
215215
var text = trim(atText.join('\n')), match;
216216
if (atName == 'param') {
217217
match = text.match(/^\{([^}=]+)(=)?\}\s+(([^\s=]+)|\[(\S+)=([^\]]+)\])\s+(.*)/);
218-
// 1 12 2 34 4 5 5 6 6 3 7 7
218+
// 1 12 2 34 4 5 5 6 6 3 7 7
219219
if (!match) {
220220
throw new Error("Not a valid 'param' format: " + text);
221221
}
@@ -729,7 +729,7 @@ function scenarios(docs){
729729
function metadata(docs){
730730
var pages = [];
731731
docs.forEach(function(doc){
732-
var path = (doc.name || '').split(/(\.|\:)/);
732+
var path = (doc.name || '').split(/(\.|\:\s*)/);
733733
for ( var i = 1; i < path.length; i++) {
734734
path.splice(i, 1);
735735
}

0 commit comments

Comments
 (0)