// stylelint-disable selector-max-type
.markdown-body {
  // Inline code snippets
  code,
  tt {
    // stylelint-disable-next-line primer/spacing
    padding: 0.2em 0.4em;
    margin: 0;
    // stylelint-disable-next-line primer/typography
    font-size: 85%;
    white-space: break-spaces; // keeps rendering spaces, but breaks them onto multiple lines
    background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted));
    // stylelint-disable-next-line primer/borders
    border-radius: $border-radius;

    br { display: none; }
  }

  del code { text-decoration: inherit; }

  samp {
    // stylelint-disable-next-line primer/typography
    font-size: 85%;
  }

  pre {
    overflow-wrap: normal;

    code {
      // stylelint-disable-next-line primer/typography
      font-size: 100%;
    }

    // Code tags within code blocks (<pre>s)
    > code {
      padding: 0;
      margin: 0;
      word-break: normal;
      white-space: pre;
      background: transparent;
      border: 0;
    }
  }

  .highlight {
    margin-bottom: var(--base-size-16);

    pre {
      margin-bottom: 0;
      word-break: normal;
    }
  }

  .highlight pre,
  pre {
    padding: var(--base-size-16);
    overflow: auto;
    // stylelint-disable-next-line primer/typography
    font-size: 85%;
    // stylelint-disable-next-line primer/typography
    line-height: 1.45;
    color: var(--fgColor-default, var(--color-fg-default));
    background-color: var(--bgColor-muted, var(--color-canvas-subtle));
    // stylelint-disable-next-line primer/borders
    border-radius: $border-radius;
  }

  pre code,
  pre tt {
    display: inline;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    overflow-wrap: normal;
    background-color: transparent;
    border: 0;
  }
}
