Course contents block produces a table of contents for the course – that is a list of all visible sections (topics or weeks) in the course. Clicking at one of these links will display that particular section.
If the section name is defined, it is used in the course contents. Otherwise, the block automatically extracts a suitable title for every week or topic from the section summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used.
Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title. If no suitable title can be populated, the current course format’s default is used.
You can download the latest version of the Course Contents block from this link: https://moodle.org/plugins/view/block_course_contents and for more detailed information about the block please check out the link: https://docs.moodle.org/28/en/Course_contents_block