Skip to content

Instantly share code, notes, and snippets.

@suin
Created July 1, 2020 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suin/f5a192d8f20a3d8451df60094b36bc5e to your computer and use it in GitHub Desktop.
Save suin/f5a192d8f20a3d8451df60094b36bc5e to your computer and use it in GitHub Desktop.
.markdown {
counter-reset: h2 0;
}
.markdown h2 {
counter-increment: h2;
counter-reset: h3 0;
}
.markdown h3 {
counter-increment: h3;
counter-reset: h4 0;
}
.markdown h4 {
counter-increment: h4;
}
.markdown h2:before {
content: counter(h2)". ";
}
.markdown h3:before {
content: counter(h2)"." counter(h3)" ";
}
.markdown h4:before {
content: counter(h2)"." counter(h3)"." counter(h4)" ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment