Skip to content

Instantly share code, notes, and snippets.

@AprilSylph
Last active May 17, 2020 16:46
Show Gist options
  • Save AprilSylph/70361dde77b5885ce21ddfaa106c264d to your computer and use it in GitHub Desktop.
Save AprilSylph/70361dde77b5885ce21ddfaa106c264d to your computer and use it in GitHub Desktop.
make HTML display as markdown syntax
h1, h2, h3, h4, h5, h6 {
font-size: 1em !important;
font-weight: normal !important;
}
h1::before { content: "# " !important; }
h2::before { content: "## " !important; }
h3::before { content: "### " !important; }
h4::before { content: "#### " !important; }
h5::before { content: "##### " !important; }
h6::before { content: "###### " !important; }
i, em {
font-style: normal !important;
}
i::before, i::after,
em::before, em::after {
content: "_" !important;
}
b, strong {
font-weight: normal !important;
}
b::before, b::after,
strong::before, strong::after {
content: "**" !important;
}
ul {
list-style-type: none !important;
}
ul > li::before {
content: "- " !important;
}
a {
text-decoration: none !important;
color: inherit !important;
}
a::before {
content: "[" !important;
}
a::after {
content: "](" attr(href) ")" !important;
text-transform: none !important;
}
code, samp, pre {
font-family: inherit !important;
}
code::before, code::after,
samp::before, samp::after {
content: "`" !important;
}
pre::before {
content: "```\000A" !important;
}
pre::after {
content: "\000A```" !important;
}
s, del {
text-decoration: none !important;
}
s::before, s::after,
del::before, del::after {
content: "~~" !important;
}
hr {
margin: 0 !important;
border: none !important;
height: auto !important;
color: inherit !important;
}
hr::before {
content: "---";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment