We have an issue with events custom tags and the new WYSIWYG ProseMirror editor: custom fields filled from the event form are not present in the generated string. It still works as before with the markdown editor.
Steps to reproduce:
Enable the Discourse Calendar plugin
Add one custom field in plugin configuration
Open a form for a new Post
Select the ProseMirror editor
Create an event with a value for the custom field (Options > Create Event)
Validate the event
Switch to Markdown editor
What is happening
The custom field is absent from the [event] tag.
What is expected
The custom field should be present in the [event] tag.
Notes
When doing the same but starting with the Markdown editor instead of ProseMirror, the custom field is present in the [event] tag.
I investigated a bit what was happening with the toolbarEvent when validating the new event: addText() method seems to receive in both cases the right markup:
폼을 검증할 때 this.args.model.toolbarEvent.addText()에 올바른 텍스트를 전달하고 있습니다.
console.log(TM)를 몇 번 찍어보니 text-manipulation.js#addText()에서 this.convertFromMarkdown(text)가 호출되고 있었습니다. 문제가 여기에서 발생하는 것 같습니다. 어떤 스키마가 강제되고 있는데, 이 스키마에는 사용자 정의 필드가 포함되어 있지 않습니다.
이 문제는 에디터 확장 프로그램 discourse-calendar/assets/javascripts/discourse/pre-initializers/rich-editor-extension.js에서 비롯됩니다. convertFromMarkdown() 함수에서 사용되는 속성 목록은 EVENT_ATTRIBUTES 상수로 정의되어 있습니다. 이 목록에 사용자 지정 필드를 추가하면 정상적으로 작동합니다.