The approach here is to first strip the HTML from the heading's content, then rendered it with markdown to get the HTML content for the TOC entry, then to strip the HTML from the rendered content again, as to get the text for the TOC entry's link.
Adds an additional dependency of striptags (MIT licensed)
Example TOC Entry, given the heading of:
```markdown
```
```javascript
{
hashLink: 'foo',
rawContent: '<a name="foo"></a> _Foo_',
content: '<em>Foo</em>',
children: []
}
```
Previously this TOC entry would be:
```javascript
{
hashLink: 'a-name-foo-a-_foo_',
rawContent: '<a name="foo"></a> _Foo_',
content: '<a name="foo"></a> <em>Foo</em>',
children: []
}
```
closes issue #1703
The warning is produced on `cssnano` call. See below:
> Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
Reproduction:
```shell
mkdir work
cd work
npx docusaurus-init
cd website
yarn install
yarn run build
```
Environments:
- Node: 12.6.0
- Yarn: 1.17.3
Currently the items in table of contents are highlighted as bold based on items being
viewed on the screen or as the user scrolls up/down on a page. Added the `primaryColor`
of the site's configuration to make the current section being viewed standout more
in the table of content.
closes#1608
* Replace apostrophe with empty string in header
This change is to replicate the github behviour with respect to apostrophe in
headers. When there is an apostrophe in a header, github replaces it with empty string
when creating an anchor link to that header. Docusaurus should follow the same convention.
* Add `unlisted` header option for blog posts, fixes#1393.
Previously, the blog sidebar listed the most recent blog posts sorted by
their publish date. This commit adds the ability to hide a specific blog
post from the sidebar and the feed of all blog posts by adding the
`unlisted: true` header option.
```md
title: My Draft Post
unlisted: true # Hide from blog sidebar and main blog page feed.
---
```
* Rename "unlisted" into "draft".
In this case, the `docsNavContainer` does not pick up any styles or attributes from the `container` component it is wrapped in.
It does however pick up the pesky `.container` className, which when paired with bootstrap, messes up the styling of the top navigation in mobile.
This change is completely non-destructive, but helps enable the use of bootstrap on top of Docusaurus.
* fix: enable live reloading title of doc
* fix: removing unnecessary reload statements
* fix: only title change should trigger a live reload
* fix: adding more properties that triggers a live reload
* fix: refactoring