build(aio): move autolink-headings to post-processing (#16336)
The autolinking is now done on the `renderedContent` which means it also captures and autolinks headings that were generated outside of markdown. PR Close #16336
This commit is contained in:

committed by
Miško Hevery

parent
de36a9b718
commit
de25cfc0cb
22
aio/tools/transforms/angular-base-package/post-processors/autolink-headings.js
vendored
Normal file
22
aio/tools/transforms/angular-base-package/post-processors/autolink-headings.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
const slug = require('rehype-slug');
|
||||
const link = require('rehype-autolink-headings');
|
||||
|
||||
/**
|
||||
* Get remark to inject anchors into headings
|
||||
*/
|
||||
module.exports = [
|
||||
slug,
|
||||
[link, {
|
||||
properties: {
|
||||
title: 'Link to this heading',
|
||||
className: ['header-link'],
|
||||
'aria-hidden': 'true'
|
||||
},
|
||||
content: {
|
||||
type: 'element',
|
||||
tagName: 'i',
|
||||
properties: {className: ['material-icons']},
|
||||
children: [{ type: 'text', value: 'link' }]
|
||||
}
|
||||
}]
|
||||
];
|
Reference in New Issue
Block a user