mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-30 15:27:24 +08:00
Fix smart cell editor when no language is specified
This commit is contained in:
parent
790c41e096
commit
165eff6734
2 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
import LiveEditor from "./cell_editor/live_editor";
|
||||
import { getAttributeOrThrow, parseBoolean } from "../lib/attribute";
|
||||
import {
|
||||
getAttributeOrDefault,
|
||||
getAttributeOrThrow,
|
||||
parseBoolean,
|
||||
} from "../lib/attribute";
|
||||
|
||||
const CellEditor = {
|
||||
mounted() {
|
||||
|
|
@ -70,7 +74,7 @@ const CellEditor = {
|
|||
return {
|
||||
cellId: getAttributeOrThrow(this.el, "data-cell-id"),
|
||||
tag: getAttributeOrThrow(this.el, "data-tag"),
|
||||
language: getAttributeOrThrow(this.el, "data-language"),
|
||||
language: getAttributeOrDefault(this.el, "data-language", null),
|
||||
intellisense: getAttributeOrThrow(
|
||||
this.el,
|
||||
"data-intellisense",
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ defprotocol Livebook.Runtime do
|
|||
@typedoc """
|
||||
Smart cell editor configuration.
|
||||
"""
|
||||
@type editor :: %{language: String.t(), placement: :bottom | :top, source: String.t()}
|
||||
@type editor :: %{language: String.t() | nil, placement: :bottom | :top, source: String.t()}
|
||||
|
||||
@typedoc """
|
||||
An opaque file reference.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue