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

defaultEditorConfig.output.markdown is ignored? #42

Open
faxg opened this issue Jul 17, 2023 · 0 comments
Open

defaultEditorConfig.output.markdown is ignored? #42

faxg opened this issue Jul 17, 2023 · 0 comments

Comments

@faxg
Copy link

faxg commented Jul 17, 2023

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;
                  },
                ],
              },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant