mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
385 lines
220 KiB
HTML
385 lines
220 KiB
HTML
|
|
<html class="" style="background: rgb(255, 255, 255);"><script type="module" src="chrome-extension://jdkknkkbebbapilgoeccciglkfbmbnfm/hook.js"></script><head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<meta name="norton-safeweb-site-verification" content="24usqpep0ejc5w6hod3dulxwciwp0djs6c6ufp96av3t4whuxovj72wfkdjxu82yacb7430qjm8adbd5ezlt4592dq4zrvadcn9j9n-0btgdzpiojfzno16-fnsnu7xd">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||
|
|
<meta name="author" content="Omnivore">
|
||
|
|
<meta property="og:url" content="https://blog.omnivore.app/p/code-block-syntax-highlighting">
|
||
|
|
<link rel="canonical" href="https://blog.omnivore.app/p/code-block-syntax-highlighting">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="shortcut icon" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/favicon.ico">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="icon" type="image/png" sizes="16x16" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/favicon-16x16.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="icon" type="image/png" sizes="32x32" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/favicon-32x32.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="57x57" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-57x57.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="60x60" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-60x60.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="72x72" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-72x72.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="76x76" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-76x76.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="114x114" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-114x114.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="120x120" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-120x120.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="144x144" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-144x144.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="152x152" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-152x152.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="167x167" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-167x167.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="180x180" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-180x180.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="apple-touch-icon" sizes="1024x1024" href="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/apple-touch-icon-1024x1024.png">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<title>Code Block Syntax Highlighting - Omnivore</title>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<link rel="alternate" type="application/rss+xml" href="/feed" title="Omnivore">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<style>
|
||
|
|
/*https://fonts.googleapis.com/css?family=Spectral:400,400i,600,600i*/
|
||
|
|
/* cyrillic */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8on7mTNmnUHowCw.woff2) format('woff2');
|
||
|
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* vietnamese */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onXmTNmnUHowCw.woff2) format('woff2');
|
||
|
|
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin-ext */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onTmTNmnUHowCw.woff2) format('woff2');
|
||
|
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onrmTNmnUHo.woff2) format('woff2');
|
||
|
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* cyrillic */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold Italic'), local('Spectral-SemiBoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qqXCWfCFXVAKArdqqQ.woff2) format('woff2');
|
||
|
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* vietnamese */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold Italic'), local('Spectral-SemiBoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qqXCWfuFXVAKArdqqQ.woff2) format('woff2');
|
||
|
|
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin-ext */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold Italic'), local('Spectral-SemiBoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qqXCWfqFXVAKArdqqQ.woff2) format('woff2');
|
||
|
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: italic;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold Italic'), local('Spectral-SemiBoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qqXCWfSFXVAKArc.woff2) format('woff2');
|
||
|
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* cyrillic */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M9knjsS_ulYHs.woff2) format('woff2');
|
||
|
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* vietnamese */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M2knjsS_ulYHs.woff2) format('woff2');
|
||
|
|
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin-ext */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M3knjsS_ulYHs.woff2) format('woff2');
|
||
|
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 400;
|
||
|
|
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M5knjsS_ul.woff2) format('woff2');
|
||
|
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* cyrillic */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold'), local('Spectral-SemiBold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9vmtm3FafaPWnIIMrY.woff2) format('woff2');
|
||
|
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* vietnamese */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold'), local('Spectral-SemiBold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9vmtm3OafaPWnIIMrY.woff2) format('woff2');
|
||
|
|
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin-ext */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold'), local('Spectral-SemiBold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9vmtm3PafaPWnIIMrY.woff2) format('woff2');
|
||
|
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
/* latin */
|
||
|
|
@font-face {
|
||
|
|
font-family: 'Spectral';
|
||
|
|
font-style: normal;
|
||
|
|
font-weight: 600;
|
||
|
|
src: local('Spectral SemiBold'), local('Spectral-SemiBold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9vmtm3BafaPWnII.woff2) format('woff2');
|
||
|
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
|
|
font-display: fallback;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<style>:root{--background_pop:#ffe682;--cover_bg_color:#FFFFFF;--print_on_pop:#1a1a1a;--border_subtle:rgba(204, 204, 204, 0.5);--background_subtle:rgba(255, 251, 236, 0.4);--print_pop:hsl(48, 100%, 40%);--cover_print_primary:#1a1a1a;--cover_print_secondary:#757575;--cover_border_color:#ffe682;--web_bg_color:#ffffff;--background_contrast_1:#f7f7f7;--background_contrast_2:#ebebeb;--background_contrast_3:#d6d6d6;--background_contrast_4:#b8b8b8;--background_contrast_5:#9a9a9a;--background_contrast_pop:rgba(255, 230, 130, 0.4);--input_background:#ffffff;--cover_input_background:#ffffff;--tooltip_background:#191919;--web_bg_color_h:0;--web_bg_color_s:0%;--web_bg_color_l:100%;--print_on_web_bg_color:#1a1a1a;--print_secondary_on_web_bg_color:#767676;--selected_comment_background_color:#fdf9f3;}</style>
|
||
|
|
|
||
|
|
<link rel="stylesheet" href="https://cdn.substack.com/theme/main.css?v=2a08d8c428485d9536f44e001c9c892b">
|
||
|
|
|
||
|
|
<style></style>
|
||
|
|
<meta property="og:type" content="article" data-preact-helmet="true"><meta property="og:title" content="Code Block Syntax Highlighting" data-preact-helmet="true"><meta property="twitter:title" content="Code Block Syntax Highlighting" data-preact-helmet="true"><meta name="description" content="Highlighted <code> in Omnivore" data-preact-helmet="true"><meta property="og:description" content="Highlighted <code> in Omnivore" data-preact-helmet="true"><meta property="twitter:description" content="Highlighted <code> in Omnivore" data-preact-helmet="true"><meta property="og:image" content="https://cdn.substack.com/image/fetch/w_1200,h_600,c_fill,f_jpg,q_auto:good,fl_progressive:steep,g_auto/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab1f7e8-2ca7-4011-8ccb-43d0b3bd244f_1490x2020.png" data-preact-helmet="true"><meta property="twitter:image" content="https://cdn.substack.com/image/fetch/w_1200,h_600,c_fill,f_jpg,q_auto:good,fl_progressive:steep,g_auto/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab1f7e8-2ca7-4011-8ccb-43d0b3bd244f_1490x2020.png" data-preact-helmet="true"><meta property="twitter:card" content="summary_large_image" data-preact-helmet="true"></head>
|
||
|
|
|
||
|
|
<body>
|
||
|
|
|
||
|
|
|
||
|
|
<div id="entry"><div id="main" class="main typography use-theme-bg"><iframe src="https://substack.com/channel-frame" class="channel-frame" width="0" height="0"></iframe><div class="main-menu animated"><div class="main-menu-content" style="position: fixed;"><div class="topbar"><div class="container"><div class="large-menu-logo-container" style="width: auto;"><a href="https://blog.omnivore.app"><img src="https://cdn.substack.com/image/fetch/w_96,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F052c15c4-ecfd-4d32-87db-13bcac9afad5_512x512.png" class="large-menu-logo"></a></div><h1 class="large-menu-name left-align"><a class="large-menu-home-link" href="https://blog.omnivore.app">Omnivore</a></h1><div class="buttons notification-container"><button class="button outline" type="button" tabindex="0">Dashboard</button><button class="button homepage-nav-user-indicator small no-margin no-active-fade signed-in" type="button" tabindex="0"><img class="menu-trigger-image" src="https://cdn.substack.com/image/fetch/w_80,h_80,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Favatars%2Fyellow.png"><ul class="dropdown-menu tooltip no-place"><div class="dropdown-menu-wrapper"><li><div class="account-menu-header">Account</div></li><li><div class="menu-scroll-container"><a href="https://substack.com/profile/start?utm_source=user-menu" class="profile-header"><img class="header-user-image" src="https://cdn.substack.com/image/fetch/w_80,h_80,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Favatars%2Fyellow.png"><div class="labels"><div class="h1">welcome@omnivore.app</div><div class="h2">Set up your profile</div></div></a><hr><a href="/account?utm_source=user_menu?utm_source=user-menu" native="true" class="indicator-menu-item undefined"><div title="Omnivore" class="pub-icon indicator-item-icon"><img src="https://cdn.substack.com/image/fetch/w_48,h_48,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F052c15c4-ecfd-4d32-87db-13bcac9afad5_512x512.png" width="24" height="24" alt="Omnivore" class="custom"></div> Manage your subscription </a><hr><a href="https://substack.com/profile/start?utm_source=user-menu" native="true" class="indicator-menu-item undefined"><svg role="img" style="height: 24px; width: 24px;" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="1" stroke="#555" xmlns="http://www.w3.org/2000/svg" class="indicator-item-icon"><g><title></title><path d="M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 11C14.2091 11 16 9.20914 16 7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7C8 9.20914 9.79086 11 12 11Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g></svg> Profile </a><a href="https://reader.substack.com?utm_source=user-menu" native="true" class="indicator-menu-item undefined"><svg role="img" style="height: 24px; width: 24px;" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="1" stroke="#000" xmlns="http://www.w3.org/2000/svg" class="indicator-item-icon"><g><title></title><path d="M2 3H8C9.06087 3 10.0783 3.42143 10.8284 4.17157C11.5786 4.92172 12 5.93913 12 7V21C12 20.2044 11.6839 19.4413 11.1213 18.8787C10.5587 18.3161 9.79565 18 9 18H2V3Z" stroke="#555" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 3H16C14.9391 3 13.9217 3.42143 13.1716 4.17157C12.4214 4.92172 12 5.93913 12 7V21C12 20.2044 12.3161 19.4413 12.8787 18.8787C13.4413 18.3161 14.2044 18 15 18H22V3Z" stroke="#555" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g></svg> Reader </a><hr><a href="https://substack.com/account/settings?utm_source=user-menu" native="true" class="indicator-me
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
(function () {
|
||
|
|
var CLASS_NAME = 'balance-text';
|
||
|
|
var LINE_HEIGHT_OFFSET = 10;
|
||
|
|
var MAXIMUM_ERROR = 4;
|
||
|
|
|
||
|
|
balanceDocument();
|
||
|
|
window.balanceText = balanceText;
|
||
|
|
window.addEventListener('load', balanceDocument);
|
||
|
|
document.addEventListener('DOMContentLoaded', balanceDocument);
|
||
|
|
|
||
|
|
function balanceDocument() {
|
||
|
|
if (!document.getElementsByClassName) return;
|
||
|
|
var elems = document.getElementsByClassName(CLASS_NAME);
|
||
|
|
for (var i = 0; i < elems.length; i++) {
|
||
|
|
balanceText(elems[i]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function balanceText(elem) {
|
||
|
|
if (isMultipleLines(elem)) {
|
||
|
|
elem.style.maxWidth = '';
|
||
|
|
squeeze(elem, elem.clientHeight, 0, elem.clientWidth);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Binary search for min width that doesnt require an extra line
|
||
|
|
function squeeze(elem, originalHeight, min, max) {
|
||
|
|
if (max - min < MAXIMUM_ERROR) {
|
||
|
|
if (elem.clientHeight > originalHeight) {
|
||
|
|
elem.style.maxWidth = max + 'px';
|
||
|
|
} else {
|
||
|
|
elem.style.maxWidth = (elem.scrollWidth + 1) + 'px';
|
||
|
|
}
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (min >= max) {
|
||
|
|
elem.style.maxWidth = max + 'px';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
var mid = (min + max) / 2;
|
||
|
|
elem.style.maxWidth = mid + 'px';
|
||
|
|
if (elem.clientHeight > originalHeight) {
|
||
|
|
squeeze(elem, originalHeight, mid, max);
|
||
|
|
} else {
|
||
|
|
squeeze(elem, originalHeight, min, mid);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function isMultipleLines(elem) {
|
||
|
|
// Save original text
|
||
|
|
var html = elem.innerHTML;
|
||
|
|
var words = elem.textContent.split(' ');
|
||
|
|
|
||
|
|
// Wrap the first word
|
||
|
|
var firstWord = document.createElement('span');
|
||
|
|
firstWord.id = 'element-first-word';
|
||
|
|
firstWord.textContent = words.shift();
|
||
|
|
elem.innerHTML = '';
|
||
|
|
elem.appendChild(firstWord);
|
||
|
|
elem.appendChild(document.createTextNode(' ' + words.join(' ')));
|
||
|
|
|
||
|
|
// Check the height of the first word
|
||
|
|
var firstWordHeight = document.getElementById('element-first-word').offsetHeight;
|
||
|
|
var elementHeight = elem.offsetHeight;
|
||
|
|
|
||
|
|
// Restore original text
|
||
|
|
elem.innerHTML = html;
|
||
|
|
|
||
|
|
// Check if the block is taller than the first word (ie multi-line)
|
||
|
|
return elementHeight - LINE_HEIGHT_OFFSET > firstWordHeight;
|
||
|
|
}
|
||
|
|
})();
|
||
|
|
</script>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<script src="https://js.sentry-cdn.com/c41771aeccbb43fbbffbc4755e65c9be.min.js" crossorigin="anonymous"></script>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<script>window._preloads = {"isEU":false,"language":"en","country":"US","base_url":"https://blog.omnivore.app","stripe_publishable_key":"pk_live_vNnuGHOFnt4mM7V9PuCAAPJz","captcha_site_key":"6LdYbsYZAAAAAIFIRh8X_16GoFRLIReh-e-q6qSa","pub":{"id":509268,"name":"Omnivore","type":"newsletter","homepage_type":"newspaper","logo_url":"https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/052c15c4-ecfd-4d32-87db-13bcac9afad5_512x512.png","logo_url_wide":null,"cover_photo_url":null,"subdomain":"omnivoreapp","author_id":49669396,"copyright":"Omnivore","custom_domain":"blog.omnivore.app","custom_domain_optional":false,"email_from":null,"trial_end_override":null,"email_from_name":"Omnivore","support_email":null,"hero_image":null,"hero_text":"Updates from the Omnivore team","hide_intro_title":null,"hide_intro_subtitle":null,"require_clickthrough":false,"theme_var_background_pop":"#FF9900","default_coupon":null,"community_enabled":true,"theme_var_cover_bg_color":null,"flagged_as_spam":false,"theme_var_color_links":false,"default_group_coupon":null,"email_banner_url":null,"created_at":"2021-10-01T02:49:41.829Z","podcast_enabled":false,"page_enabled":false,"apple_pay_disabled":false,"fb_pixel_id":null,"ga_pixel_id":null,"twitter_pixel_id":null,"parsely_pixel_id":null,"keywee_pixel_id":null,"podcast_title":null,"podcast_art_url":null,"podcast_feed_url":null,"image_thumbnails_always_enabled":false,"hide_podcast_feed_link":false,"payments_survey_status":null,"first_enabled_payments_at":null,"embed_tracking_disabled":false,"minimum_group_size":4,"parent_publication_id":null,"bylines_enabled":true,"byline_images_enabled":true,"post_preview_limit":null,"default_write_comment_permissions":"none","default_post_publish_send_email":true,"google_site_verification_token":null,"fb_site_verification_token":null,"google_tag_manager_token":null,"language":"en","paid_subscription_benefits":null,"free_subscription_benefits":null,"founding_subscription_benefits":null,"parent_about_page_enabled":true,"invite_only":false,"subscriber_invites":0,"default_comment_sort":"best_first","rss_website_url":null,"rss_feed_url":null,"sibling_rank":null,"payments_state":"disabled","bitcoin_enabled":false,"default_show_guest_bios":true,"chartable_token":null,"expose_paywall_content_to_search_engines":true,"podcast_byline":null,"paywall_free_trial_enabled":false,"theme":{"publication_id":509268,"background_pop_color":"#ffe682","cover_bg_color":null,"web_bg_color":"#ffffff","color_links":null,"font_preset_heading":null,"font_preset_body":null,"font_family_headings":null,"font_family_body":null,"font_family_ui":null,"font_size_body_desktop":null,"print_secondary":null,"custom_css_web":null,"custom_css_email":null},"plans":null,"stripe_user_id":null,"stripe_country":null,"stripe_publishable_key":null,"author_name":"Omnivore","author_photo_url":null,"author_bio":"Omnivore is the home for everything you read; automatically organized and easy to share","has_child_publications":false,"public_user_count":1,"has_posts":true,"first_post_date":"2021-10-13T19:39:10.254Z","has_podcast":false,"has_subscriber_only_podcast":false,"has_community_content":false,"rankingDetail":"Launched 5 months ago","rankingDetailFreeIncluded":"Launched 5 months ago","tier":2,"no_follow":false,"no_index":false,"can_set_google_site_verification":true,"can_have_sitemap":true,"draft_plans":null,"base_url":"https://blog.omnivore.app","hostname":"blog.omnivore.app","is_on_substack":false,"parent_publication":null,"child_publications":[],"sibling_publications":[],"sections":[],"subscribeCardVersionHash":"e03aaf5cd51e4035f38f2aa621f6a29c"},"user":{"id":49669396,"name":"Omnivore","email":"welcome@omnivore.app","photo_url":null,"bio":"Omnivore is the home for everything you read; automatically organized and easy to share","subscription_expiry":"2121-10-02T02:49:41.842Z","subscription_type":null,"subscription_id":87191302,"stripe_subscription_id":null,"stripe_platform_customer_id":"cus_KKSWyx1jUeqiEM","anonymous_id":"87d13a84-a2f3-467e-8f8b-eaf2427c93cf","subdomain":"omnivo
|
||
|
|
<script>window._analyticsConfig = {"user":{"id":49669396,"name":"Omnivore","email":"welcome@omnivore.app"},"anonymousId":"87d13a84-a2f3-467e-8f8b-eaf2427c93cf","properties":{"subdomain":"omnivoreapp","publication_id":509268,"has_plans":false,"pub_community_enabled":true,"parent_publication_id":null,"parent_publication_subdomain":null,"is_parent_publication":false,"section_name":null,"section_slug":null,"section_id":null,"section_is_podcast":null,"is_subscribed":true,"is_free_subscribed":true,"is_author":true,"is_contributor":true,"is_admin":true,"country":"US","language":"en"}}</script>
|
||
|
|
<script src="https://cdn.substack.com/min/main.bundle.js?v=128b39-17f51edf680" charset="utf-8"></script>
|
||
|
|
|
||
|
|
<!-- Fallback tracking pixels -->
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<noscript>
|
||
|
|
<style>
|
||
|
|
#nojs-banner {
|
||
|
|
position: fixed;
|
||
|
|
bottom: 0;
|
||
|
|
left: 0;
|
||
|
|
padding: 16px 16px 16px 32px;
|
||
|
|
width: 100%;
|
||
|
|
box-sizing: border-box;
|
||
|
|
background: red;
|
||
|
|
color: white;
|
||
|
|
font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||
|
|
font-size: 13px;
|
||
|
|
line-height: 13px;
|
||
|
|
}
|
||
|
|
#nojs-banner a {
|
||
|
|
color: inherit;
|
||
|
|
text-decoration: underline;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
|
||
|
|
<div id="nojs-banner">
|
||
|
|
This site requires JavaScript to run correctly. Please <a href="https://enable-javascript.com/" target="_blank">turn on JavaScript</a> or unblock scripts
|
||
|
|
</div>
|
||
|
|
</noscript>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</body></html>
|