Skip to content

Commit

Permalink
chore: handle blank output lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Oct 15, 2020
1 parent 0ed5a72 commit abd2666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/Terminal/Output.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const Output = ({ line }) => (
key={key}
css={css`
color: ${OUTPUT_COLORS[token.color] || OUTPUT_COLORS.plain};
&:empty {
display: inline-block;
}
`}
>
{token.text}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Terminal/SyntaxHighlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Command from './Command';
import Output from './Output';

const MULTILINE_COMMAND = /\\\s*$/;
const OUTPUT_TAG = /^\[output\]\s/;
const OUTPUT_TAG = /^\[output\](\s|$)/;
const OUTPUT_COLOR_TOKENS = /{([a-z]+)}(.*?(?={|$))/g;

const SyntaxHighlighter = ({ code }) => (
Expand Down

0 comments on commit abd2666

Please sign in to comment.