Inline Code

This is Inline Code

Only pre

This is pre text

Code block with backticks

< < ! h / D t < < h O m h b / t C l e < < < h o < b m T a m t m e d p o l Y l d e i e n c a y > d > P a > t t t a o d > T y E n a l a m n > e > g e e t s h = c > = e t t " h E " n < m e a x d t / l n r a e = p > " s m s " > > e p c S t l r a = e i m " p p u H t l t T i e f M o - L n a 8 5 " r " t D i o c c l u e m e s n h t o < w / c t a i s t i l n e g > b a s i c M a r k d o w n s y n t a x a n d f o r m a t t i n g f o r H T M L e l e m e n t s . "

Code block with backticks and language specified

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block with backticks and language specified with line numbers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block with line numbers and highlighted lines

  • PaperMod supports linenos=true or linenos=table
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>
  • With linenos=inline line might not get highlighted properly.
  • This issue is fixed with 045c084
 1<!DOCTYPE html>
 2<html lang="en">
 3  <head>
 4    <meta charset="utf-8" />
 5    <title>Example HTML5 Document</title>
 6    <meta
 7      name="description"
 8      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
 9    />
10  </head>
11  <body>
12    <p>Test</p>
13  </body>
14</html>

Code block indented with four spaces

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

Code block with Hugo’s internal highlight shortcode

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

Github Gist