Skip to content

defaultEditorConfig.output.markdown is ignored? #42

@faxg

Description

@faxg

I try to populate the "markdown" field whenever the field is saved.
See FieldComponent.tsx, line 165

However, even after setting the defaultEditorConfig.output.markdown.enabled = true;
the markdown property does not seem to be set:

  lexicalRichTextField({
              name: "lexical_content",
              label: "Content",
              localized: true,

              editorConfigModifier: (defaultEditorConfig) => {
                // This should populate the "markdown" property of the field, according to 
                defaultEditorConfig.output.markdown.enabled = true;
                defaultEditorConfig.output.html.enabled = true;

                return defaultEditorConfig;
              },
              hooks: {
                // see: https://payloadcms.com/docs/hooks/fields
                beforeChange: [
                  (args) => {
                    // TODO markdown is undefined
                    args.data.as_markdown = args.data.lexical_content.markdown;
                    return args.value;
                  },
                ],
              },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions