Skip to content

Instantly share code, notes, and snippets.

@vimtaai
vimtaai / markdown-flavors.md
Last active September 7, 2024 06:03
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM
@vimtaai
vimtaai / luminance.scss
Last active May 13, 2021 22:49
Functions to calculate luminance of colors and contrast ratio of colors in SASS
// Calulates power with integer exponent
@function pow($number, $exponent) {
$value: 1;
@if $exponent > 0 {
@for $i from 1 through $exponent {
$value: $value * $number;
}
} @else if $exponent < 0 {
@for $i from 1 through -$exponent {
@vimtaai
vimtaai / import-base.js
Last active August 29, 2024 20:15
Web components for inline importing HTML and SVG files
export class ImportBase extends HTMLElement {
static observedAttributes = ["src"];
async attributeChangedCallback(_1, _2, src) {
const response = await fetch(src);
if (response.ok) {
this.setHTMLUnsafe(await response.text());
this.onBeforeReplace();
this.replaceWith(...this.children);