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: accepte un rendu de Yaml vide #1029

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion front/src/components/Write/PreviewPaged.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Preview ({ preview, yaml }) {

useEffect(() => {
if (html && isLoading) {
const [metadata] = YAML.loadAll(yaml)
const [metadata = {}] = YAML.loadAll(yaml)
const render = compileTemplate(template)

const base64Stylesheet = `data:text/css;base64,${btoa(stylesheet)}`
Expand Down
2 changes: 1 addition & 1 deletion front/src/components/Write/yamleditor/YamlEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Form from '../../Form'
import YAML from 'js-yaml'

export default function YamlEditor ({ yaml, basicMode, onChange }) {
const [parsed] = YAML.loadAll(yaml)
const [parsed = {}] = YAML.loadAll(yaml)

// we convert YYYY/MM/DD dates into ISO YYYY-MM-DD
if (parsed.date) {
Expand Down
Loading