Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't autoselect markdown renderer #2663

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {toast} from '../../../../../../common/components/elements/Toast';
import Markdown from '../../../../../../common/components/Markdown';
import {MOON_150} from '../../../../../../common/css/color.styles';
import {TargetBlank} from '../../../../../../common/util/links';
import {isLikelyMarkdown} from '../../../../../../util/markdown';
import {Alert} from '../../../../../Alert';
import {Button} from '../../../../../Button';
import {CodeEditor} from '../../../../../CodeEditor';
Expand Down Expand Up @@ -75,9 +74,13 @@ PreserveWrapping.displayName = 'S.PreserveWrapping';

const getDefaultFormat = (value: string): Format => {
// TODO: Add JSON detection.
if (isLikelyMarkdown(value)) {
return 'Markdown';
}
// We previously would autoselect the markdown renderer if the string appeared
// to have markdown content. Unfortunately, our markdown renderer can hang
// for several seconds on large strings and was particularly a problem when
// the user would do something like expand all inputs. Rendering the markdown
// is nice for cases like embedded code or images, so it would be nice to revisit
// this if we can fix the issue with the renderer somehow. Leaving this function
// in the code for that reason.
return 'Text';
};

Expand Down
Loading