Skip to content

Instantly share code, notes, and snippets.

@kd7lxl
Created August 4, 2016 03:30
Show Gist options
  • Select an option

  • Save kd7lxl/41321c20855eda8614e1b24effe82fcd to your computer and use it in GitHub Desktop.

Select an option

Save kd7lxl/41321c20855eda8614e1b24effe82fcd to your computer and use it in GitHub Desktop.
TOC skips items between HTML tags

One

Two

Three

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<nav id="TOC">
<ul>
<li><a href="#one">One</a></li>
<li><a href="#three">Three</a></li>
</ul>
</nav>
<h1 id="one">One</h1>
<div>
<h1 id="two">Two</h1>
</div>
<h1 id="three">Three</h1>
</body>
</html>
pandoc -s --toc -t html5 input.md -o output.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment