Browse Source

fix: #708, #709

fix/enable-imgix
Thomas Osmonson 5 years ago
committed by Thomas Osmonson
parent
commit
d49aed18c4
  1. 3
      src/components/mdx/components/code.tsx
  2. 1
      src/components/mdx/md-contents.tsx
  3. 2
      src/components/toc.tsx

3
src/components/mdx/components/code.tsx

@ -49,7 +49,8 @@ export const Code: React.FC<
const convertSingleChildToString = child => onlyText(child).replace(/\n/g, ''); const convertSingleChildToString = child => onlyText(child).replace(/\n/g, '');
const tokenLines = Children.toArray(children).map(convertSingleChildToString); const tokenLines = Children.toArray(children).map(convertSingleChildToString);
const codeString = tokenLines.join('\n');
const codeString = tokenLines.filter(line => line !== '').join('\n');
const { hasCopied, onCopy } = useClipboard(codeString); const { hasCopied, onCopy } = useClipboard(codeString);

1
src/components/mdx/md-contents.tsx

@ -73,7 +73,6 @@ export const styleOverwrites = {
}, },
'p, li': { 'p, li': {
overflowWrap: 'break-word', overflowWrap: 'break-word',
display: 'inline-block',
...getCapsizeStyles(16, 26), ...getCapsizeStyles(16, 26),
}, },
li: { li: {

2
src/components/toc.tsx

@ -35,8 +35,6 @@ const Item = ({
const isActive = isOnScreen || _isActive; const isActive = isOnScreen || _isActive;
const render = level === 2;
const adjustedLevel = level - 2; const adjustedLevel = level - 2;
return adjustedLevel > 0 && adjustedLevel <= 2 ? ( return adjustedLevel > 0 && adjustedLevel <= 2 ? (
<Box pl={getLevelPadding(level - 2)} py={space('extra-tight')}> <Box pl={getLevelPadding(level - 2)} py={space('extra-tight')}>

Loading…
Cancel
Save