merge fix
This commit is contained in:
parent
f9ad58eba5
commit
0698bd95b3
@ -73,8 +73,11 @@ module.exports = new Package('angular.io', [basePackage])
|
|||||||
|
|
||||||
|
|
||||||
.config(function(templateEngine, getInjectables) {
|
.config(function(templateEngine, getInjectables) {
|
||||||
templateEngine.filters = templateEngine.filters.concat(getInjectables([require('./rendering/trimBlankLines')]));
|
templateEngine.filters = templateEngine.filters.concat(getInjectables([
|
||||||
templateEngine.filters = templateEngine.filters.concat(getInjectables([require('./rendering/indentForMarkdown')]));
|
require('./rendering/trimBlankLines'),
|
||||||
});
|
require('./rendering/toId'),
|
||||||
|
require('./rendering/indentForMarkdown')
|
||||||
|
]));
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
8
public/api-builder/angular.io-package/rendering/toId.js
Normal file
8
public/api-builder/angular.io-package/rendering/toId.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module.exports = function toId() {
|
||||||
|
return {
|
||||||
|
name: 'toId',
|
||||||
|
process: function(str) {
|
||||||
|
return str.replace(/[^(a-z)(A-Z)(0-9)._-]/g, '-');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
18
public/api-builder/angular.io-package/rendering/toId.spec.js
Normal file
18
public/api-builder/angular.io-package/rendering/toId.spec.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
var factory = require('./toId');
|
||||||
|
|
||||||
|
describe('toId filter', function() {
|
||||||
|
var filter;
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
filter = factory();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be called "toId"', function() {
|
||||||
|
expect(filter.name).toEqual('toId');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should convert a string to make it appropriate for use as an HTML id', function() {
|
||||||
|
expect(filter.process('This is a big string with €bad#characaters¢\nAnd even NewLines'))
|
||||||
|
.toEqual('This-is-a-big-string-with--bad-characaters--And-even-NewLines');
|
||||||
|
});
|
||||||
|
});
|
@ -30,7 +30,7 @@ p.location-badge.
|
|||||||
|
|
||||||
{%- if doc.constructorDoc %}
|
{%- if doc.constructorDoc %}
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
h3 {$ doc.constructorDoc.name $}
|
h3#{$ doc.constructorDoc.name | toId $} {$ doc.constructorDoc.name $}
|
||||||
|
|
||||||
{% if doc.constructorDoc.parameters %}
|
{% if doc.constructorDoc.parameters %}
|
||||||
pre.prettyprint
|
pre.prettyprint
|
||||||
@ -45,7 +45,7 @@ p.location-badge.
|
|||||||
|
|
||||||
{%- for member in doc.members %}{% if not member.private %}
|
{%- for member in doc.members %}{% if not member.private %}
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
h3 {$ member.name $}{% if member.optional %}?{% endif %}
|
h3#{$ member.name | toId $} {$ member.name $}{% if member.optional %}?{% endif %}
|
||||||
|
|
||||||
{% if member.parameters %}
|
{% if member.parameters %}
|
||||||
pre.prettyprint
|
pre.prettyprint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user